zyrouge / symphony

🎵 Lightweight, elegant music player for Android 9+.
https://zyrouge.github.io/symphony/
GNU Affero General Public License v3.0
1.18k stars 78 forks source link

[Bug] Normal .m3u playlist import does not work #544

Open CodingSamS opened 4 months ago

CodingSamS commented 4 months ago

Description

Importing a normal .m3u playlist results in an empty playlist. However, importing an extended .m3u playlist does work.

Non-working .m3u playlist:

/storage/emulated/0/Music/Music Library/Secret Service/Oh Susie/01 Ten O'Clock Postman.m4a

Working .m3u playlist:

#EXTM3U

#EXTINF:0,01 Ten O'Clock Postman.m4a
/storage/emulated/0/Music/Music Library/Secret Service/Oh Susie/01 Ten O'Clock Postman.m4a

Steps to Reproduce

  1. Go to Playlists Tab
  2. Click on "Import Playlist"
  3. Import the .m3u file
  4. After Import look into playlist
  5. Result: The playlist is empty

Expected Behavior

The playlist should contain the tracks mentioned in the .m3u file.

Device

Checklist

zyrouge commented 4 months ago

I've never seen the non-extended format being used. That said, this is easy to implement but parsing extended format is more secure since it is structured. Is there any specification about the non-extended one?

CodingSamS commented 4 months ago

According to Wikipedia there is no specification - it's a de facto standard.

https://en.m.wikipedia.org/wiki/M3U

But it is simple - only absolute paths, relative paths and URLs.

CodingSamS commented 4 months ago

I found a pretty good summary of the format here:

https://gonze.com/playlists/playlist-format-survey.html#M3U

atkirtland commented 2 months ago

It would also be useful to m3u files formatted as below, a slight generalization to the suggestion above

#EXTM3U
#EXT-X-RATING:(number)
(track location)
...

I noticed this is the format Poweramp uses. I imagine other music apps might also add nonstandard fields to the m3u file, but they likely begin the extra fields with a #. It seems like these could be taken account of altogether by ignoring the first #EXTM3U line, considering # above a link to denote a comment, and extracting data only from the commented lines Symphony is aware of.