Fix spotify m3u Windows path parsing

This commit is contained in:
2026-04-12 10:03:43 -05:00
parent c2db2b51e7
commit 26a968797c
4 changed files with 46 additions and 3 deletions

View File

@@ -26,6 +26,18 @@ test("falls back to filename when EXTINF is absent", () => {
assert.equal(refs[0].title, "Karma Police");
});
test("falls back to the filename from Windows paths", () => {
const refs = parseM3u(String.raw`C:\Users\fiori\iCloudDrive\Music\Classic Hits\Owner of a Lonely Heart.mp3`);
assert.deepEqual(refs, [
{
source: "Owner of a Lonely Heart",
query: "Owner of a Lonely Heart",
title: "Owner of a Lonely Heart"
}
]);
});
test("reads m3u from file", async () => {
const root = await mkdtemp(join(tmpdir(), "spotify-m3u-"));
const path = join(root, "playlist.m3u8");