Skip to content

Add support for playlists#840

Merged
zeebok merged 8 commits into
mainfrom
playlist-object
May 19, 2026
Merged

Add support for playlists#840
zeebok merged 8 commits into
mainfrom
playlist-object

Conversation

@zeebok
Copy link
Copy Markdown
Contributor

@zeebok zeebok commented Mar 29, 2026

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.

@zeebok zeebok requested a review from a team March 29, 2026 16:33
Comment thread src/Application.vala

// Don't add the playlist file itself
continue;
}
Copy link
Copy Markdown
Contributor Author

@zeebok zeebok Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@teamcons
Copy link
Copy Markdown
Contributor

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.

thank you for overtaking. I wasnt feeling that one anymore.

Copy link
Copy Markdown
Collaborator

@jeremypw jeremypw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/PlaylistObject.vala Outdated
@zeebok
Copy link
Copy Markdown
Contributor Author

zeebok commented May 15, 2026

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?

@jeremypw
Copy link
Copy Markdown
Collaborator

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.

@zeebok zeebok requested a review from jeremypw May 16, 2026 21:02
Copy link
Copy Markdown
Collaborator

@jeremypw jeremypw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");

@zeebok zeebok requested a review from jeremypw May 17, 2026 15:14
Copy link
Copy Markdown
Collaborator

@jeremypw jeremypw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Let's go!

Next thing will be to expose this action in the UI e.g. with headerbar button.

@zeebok zeebok merged commit 9738895 into main May 19, 2026
3 checks passed
@zeebok zeebok deleted the playlist-object branch May 19, 2026 04:37
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.

How to import playlist?

3 participants