meeb / tubesync

Syncs YouTube channels and playlists to a locally hosted media server
GNU Affero General Public License v3.0
1.86k stars 119 forks source link

Feature Request: Configurable Queue Priorities #535

Open willhughes-au opened 3 weeks ago

willhughes-au commented 3 weeks ago

Perhaps I'm using it wrong, but TubeSync seems to perform poorly when you add more than a handful of playlists/channels to it. I believe that, at least in part, this is caused by the Queue Priorities being not optimal.

Currently it seems that actually downloading media is the last thing that will happen, so the task queue grows massively with the various tasks that need to be completed.

What should happen, IMO is that the queue priorities should be inverted, or at least tweaked. Downloading media that's been discovered should be the highest priority, followed by thumbnails and metadata, with the discovery tasks being lowest priority.

Having the various task priorities read from env vars would do the trick, if you don't want to make this a global change for everyone.

Would you accept a PR to make these priorities read from env vars?

meeb commented 3 weeks ago

Hi, thanks for the issue.

The metadata must be downloaded first, media items cannot be downloaded without the metadata. The metadata contains the video and audio streams that are available, subtitle information etc.

You could potentially re-order this to download metadata first, then media, then thumbnails, but really this shouldn't be a big issue. The only way tubesync will ever take a long time processing thumbnails is as a one-off when you initially add a very large channel or playlist. Once it's added and performed the initial sync only incrementally added media will be indexed.

Re-ordering priorities for this would result in the very minor change of media downloading before thumbnails. Given thumbnails are quick to download, the trade-off here is if you added a massive channel your tubesync instance may be downloading media for a very long time while the interface just shows no thumbnails so this likely isn't worth it.