Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize backslashes in track paths to fix broken playlists on Windows #531

Merged
merged 1 commit into from
May 1, 2020

Conversation

GilgameshxZero
Copy link
Contributor

On Windows, [email protected] adds tracks with slash paths ("C:/path/track.mp3"), but interprets playlist tracks with backslash paths ("C:\path\track.mp3"). Without resolving track paths (thus normalizing slashes to backslashes), playlists will never find tracks to add, and thus will always be empty.

You can see this by creating a test directory, and placing a track.mp3 and a playlist.m3u in the directory. In playlist.m3u, have one line adding the track:

track.mp3

Upon adding the directory to the library on [email protected], the playlist will be empty (here, resolved filePath is without the resolution; I just forgot to take out the console.log):

image

However, by resolving the filePath for each track, the playlist will be interpreted correctly:

image

The PR also updates a small number of outdated comments.

@martpie
Copy link
Owner

martpie commented May 1, 2020

Good catch, thank you very much!

@martpie
Copy link
Owner

martpie commented May 1, 2020

I will try to release this tomorrow 👍

@martpie martpie merged commit 97dd945 into martpie:master May 1, 2020
martpie added a commit that referenced this pull request May 25, 2022
Normalize backslashes in track paths to fix broken playlists on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants