UltraStar-Deluxe / Play

Free and open source singing game with song editor for desktop, mobile, and smart TV

Home Page:https://ultrastar-play.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

M3U as playlist format

achimmihca opened this issue · comments

Actual behaviour

At the moment the playlist format of UltraStar Play uses artist and title to reference songs.
This can cause conflicts easily and is not compatible with other programs / tools.

Expected behaviour

  • Better use a standard format for playlists. I suggest to use M3U.
  • Such playlists can be edited and played with other media players (e.g. VLC / Winamp / everything decent).
  • Plus, people may already have a bunch of playlists that can then be used with UltraStar Play.

M3U Format

  • M3U is a plain text format
  • Comments start with #.
  • A audio or video file is referenced by either its absolute path or relative path
    • Relative paths are relative to the M3U file

Parsing M3U

  • UltraStar Play can scan for M3U files in configured song folders, plus persistentDataPath/Playlists.
  • Comments and other lines should be preserved when saving the playlist. These lines cannot just be skipped

Finding Matching songs

  • UltraStar Play can find matching songs by constructing absolute audio / video file paths and check if these are equal
    • If the #MP3 tag of a song file is a URI (e.g. http://my-host/my-song.mp3) or network path (e.g. \\my-host\my-share\bla.mp3), then this will be compared with the absolute path from the playlist.

Saving M3U

  • A new playlist will be created in persistentDataPath/Playlists with absolute paths.
  • Saving a playlist will check whether the playlist uses relative or absolute paths and continues to do so
  • Saving a playlist must keep comments and unknown lines
  • The order of songs must be preserved
  • The #MP3 tag of a song file should written to the playlist (not #VIDEO)
  • If the #MP3 tag of a song file is a URI (e.g. http://my-host/my-song.mp3) or network path (e.g. \\my-host\my-share\bla.mp3), then this is written to the playlist.
    • Note that this is probably not standard in M3U and may mess with other media players.
    • As alternative, such songs could be added as some form of comment.
      • I am unsure what is best approach here
commented

Back then, one of the main design goals behind the UltraStar playlist feature was that groups / communities can make them once, and then "easily" share them, no matter where song files are from, no matter if the headers are the same, and no matter where they are located or how the actual mp3 file is called (in majority of cases they are just called song.mp3 or audio.mp3 anyways). The primary identifier in a M3U is the location, it does not care about anything .txt file related, thus I am not yet convinced that "editing UltraStar M3U files with external media players" is gonna work.
Additionally, it would be nice if UltraStar Play eventually adds support for loading "old" UltraStar playlists.

The primary identifier in a M3U is the location, it does not care about anything .txt file related

Good point, portability of M3U playlists might be worse.

I still think M3U support would be nice for existing playlists of users.
Howover, it could be added in addition to the current playlist format used by UltraStart Play.

support for loading "old" UltraStar playlists

Which playlist format do you mean? Does USDX have playlists?

commented

Which playlist format do you mean? Does USDX have playlists?

Yes, it does. See the folder playlists in USDX. Files are txt files with file ending .upl (UltrastarPlayList).
Looks like this:

######################################
#Ultrastar Deluxe Playlist Format v1.0
#Playlist chill with 7 Songs.
######################################
#Name: Chill
#Songs:
Evening Star : Land of Equestria
Panty & Stocking : Fallen Angel (Ending)

I guess the format is a bunch of header stuff followed by a list of artist : title?

I was not aware of this when I implemented #158.

I think it would be wise to use this as default format instead of the current playlist format used by UltraStar Play (it is pretty much the same but without header and with colon instead of dash to separate title and artist).

M3U could still be added as alternative format.

Panty & Stocking : Fallen Angel (Ending)

Ooh, I like this song :)