nukeop / nuclear

Streaming music player that finds free music for you
https://nuclear.js.org/
GNU Affero General Public License v3.0
12.02k stars 1.04k forks source link

Playlist net request issues #1609

Closed trudnorx closed 4 months ago

trudnorx commented 4 months ago

Platform: Any

Nuclear version: Latest

Description of the issue:

  1. Every time a playlist is loaded, nuclear immediately starts making network requests for every item in the playlist (e.g. searching YT). This quickly adds up to several MBs of data for large playlists. It may be more sensible to only make requests for the current plus next track or 5-10 tracks next to the currently playing one.
  2. This also applies to track images, though these take much less data than the YT searches. For images something similar could be done but based on how far the user has scrolled.
  3. Nuclear makes stream verification requests even if the user disables these.
  4. This info (points 1-3) doesn't seem to persist across sessions, so the next time you play that same playlist, nuclear needs to make all these requests again.
nukeop commented 4 months ago

1) It makes for a better user experience if the streams for the whole playlist are retrieved in the background one by one, it allows for (almost) seamless playback. It's a miniscule amount of data, compared to the actual audio streams, and it's just one track at a time. 2) Images are already fetched by the time you add them to the queue, so no extra requests are needed. 3) This was a bug, I fixed it now. 4) The retrieved stream URLs are ephemeral and need to be refreshed because they expire within a short time.