Add support for playlists#840
Conversation
|
|
||
| // Don't add the playlist file itself | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Thinking about the code more, I am curious if this should maybe live in PlaybackManager.queue_file and check if the playlist file is a supported type, that way anything that falls under "audio/x-mpegurl" but is not an m3u causes the invalid file toast instead of being added to the queue as a broken AudioObject?
There was a problem hiding this comment.
audio/x-mpegurl should be m3u or m3u8
dont confuse with audio/mpeg
unless mime-type.com speaks lies, but mimetype.io seems to say the same thing
There was a problem hiding this comment.
Well for some reason playlist extensions of other programs (like a fake .pls file) will be visible with that filter? Maybe I shouldn't worry about it until it is actually a problem that happens with other people lol
thank you for overtaking. I wasnt feeling that one anymore. |
jeremypw
left a comment
There was a problem hiding this comment.
Basically works, but I noticed one quirk: You can load the same playlist multiple times resulting multiple copies in the queue. Shouldn't loading a playlist overwrite the existing one? Also if you close and reopen the app with such a duplicated playlist then the duplicate entries appear as full file paths not the name of the track.
I'll do some more testing.
In regards to this, would your PR for checking for duplicates would resolve this? |
Yes, it should do. It was due to pre-existing issue, not this PR. |
There was a problem hiding this comment.
This works pretty well now. The only thing I noticed is that when saving a playlist, existing playlists did not appear when the Playlist filter was active, only when the "All Files" filter was active. This is because you used add_pattern with a mime-type not a glob pattern. So it should be add_pattern ("*.m3u") for example, and/or playlist_filter.add_mime_type ("audio/mpegurl");
jeremypw
left a comment
There was a problem hiding this comment.
Looks good. Let's go!
Next thing will be to expose this action in the UI e.g. with headerbar button.
Closes #319
Builds off of the previous PR but addresses some outstanding changes and moves the playlist logic to an Object. Currently only supports reading .m3u extension playlists.