Skip to content
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

Open
2 tasks done
AlexInCube opened this issue Oct 26, 2024 · 8 comments
Open
2 tasks done

Add more data in Playlist Info #1108

AlexInCube opened this issue Oct 26, 2024 · 8 comments

Comments

@AlexInCube
Copy link

AlexInCube commented Oct 26, 2024

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

  • I have checked for duplicate issues
  • I have checked for existing plugins
@devoxin
Copy link
Member

devoxin commented Oct 26, 2024

Total duration and track count seems useless to add when you can calculate this yourself.

@freyacodes
Copy link
Member

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.

@AlexInCube
Copy link
Author

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?

@freyacodes
Copy link
Member

But what to do with thumbnail playlist?

What about them? I don't know what you mean by "thumbnail playlist"

@devoxin
Copy link
Member

devoxin commented Oct 27, 2024

But it would be more convenient if it was built in.

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

@topi314
Copy link
Member

topi314 commented Oct 27, 2024

More metadata for playlists is something supported in the LavaSrc plugin via the pluginInfo JSON field.
https://github.com/topi314/LavaSrc#playlist

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.

@topi314
Copy link
Member

topi314 commented Oct 27, 2024

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.

@freyacodes
Copy link
Member

But what to do with thumbnail playlist?

What about them? I don't know what you mean by "thumbnail playlist"

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants