-
-
Notifications
You must be signed in to change notification settings - Fork 670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more data in Playlist Info #1108
Comments
Total duration and track count seems useless to add when you can calculate this yourself. |
Track count and track duration are trivial to calculate, often each requiring only a single line of code in some languages. Track URI is not something that Lavaplayer provides. If you load a playlist, you most likely already have a URI on hand for it already. |
But it would be more convenient if it was built in. But what to do with thumbnail playlist? |
What about them? I don't know what you mean by "thumbnail playlist" |
It's not something we will likely add. As Freya has stated, it can be implemented usually within one line. For example: track_count = len(playlist.tracks)
duration = sum(track.length for track in playlist.tracks) const trackCount = playlist.tracks.length;
const duration = playlist.tracks.map(track => track.length).reduce((a, b) => { a + b }, 0); int trackCount = playlist.getTracks().size;
long duration = playlist.getTracks().stream().mapToLong(track -> track.getDuration()).sum(); |
More metadata for playlists is something supported in the LavaSrc plugin via the I've been considering adding more fields in a future lavaplayer v3/lavalink v5. That being said, this could also be added in a backwards compatible manner to lavaplayer v2 and I think it would be a reasonable thing to do. Generally I would love tracks/playlists to carry more metadata in general. |
The track count can also be inaccurate for especially large playlists, since most sources have some sort of max pages setting which limits the amount of track pages being fetched. In this case a server calculated tracks count can be interesting, perhaps there should be some kind of pagination but that's not something anyone has complained about yet afaik. |
I now see that you likely mean thumbnail URL. This is a very reasonable thing to expect, however underlying support is lacking in Lavaplayer. @topi314 gave a good answer on that. |
Change request
I want the playlist info have fields for "uri, tracks count, total duration of tracks, source and thumbnail url".
Relevance
It would make it easier to work with playlists
Could this be a plugin instead?
No
Checklist
The text was updated successfully, but these errors were encountered: