Importing playlist failed
Checklist
- [X] I can reproduce the bug with the latest version given here.
- [X] I made sure that there are no existing issues - open or closed - to which I could contribute my information.
- [X] I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
- [X] I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
- [X] I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
- [X] This issue contains only one bug.
- [X] I have read and understood the contribution guidelines.
Affected app version
1.0.0
Affected Android/Custom ROM version
Android 11 (MIUI Global 12.5.2)
Affected device model
Mi 10 Lite 5G
How did you install the app?
F-Droid / IzzyOnDroid
Steps to reproduce the bug
Given following directory structure in Music dir:
lib/
song 1.opus
song 2.opus
playlist.m3u
And following playlist.m3u file content:
lib/song 1.opus
lib/song 2.opus
(I also tried with backslashes, without success)
- press Import Playlist
- choose file
playlist.m3u
Expected behavior
Playlist should be imported correctly, using relative file paths
Actual behavior
Import fails
Screenshots/Screen recordings
There is only small popup with Import failed on it.
Additional information
here are some examples of valid .m3u files. Note example 3 and 4 with relative file paths.
By the way, thanks for this app, especially it's built in equalizer. Good job guys!
This is something I'd be interested in fixing. I have these m3u playlists all through my Music folder and none import.
I'd also love to add a feature that adds all playlists found automatically when scanning (perhaps naming based on filename).
I was able to work around the issue by first creating a simple playlist in Music Player and exporting it to see what path it used, then modifying my M3U files to use the same path prefix on all the files to become absolute paths. Not super convenient, but gets me my playlists.
The M3U parser library Music Player uses supports relative paths but they clearly don't seem to work in this case. I suspect the issue is something like the true location of the playlist file not being available to the parser so it doesn't know where to start for relative paths (maybe because of the way Android handles files? not my area).
In most languages that's simply an extra library call, you use one library call to get the absolute path to the current running file, then use that to resolve the relative path to the one you want. Unless something about Android is really weird, the one should be deterministic from the other