meeb / tubesync

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

"Skipping" unavailable media causes it to get unskipped? #330

Open kuhnchris opened 1 year ago

kuhnchris commented 1 year ago

Hi, maybe I'm still missing "something" here, but I have following use-case: One of these aaaaaaaaaaaaages old videos (Mighty Mushin' Emo Rangers) I tried to add/download was (errorously) marked as "not able to be downloaded", so I actually wanted to "skip" the media for now, but it keeps getting re-un-skipped by signals.py->media_post_save.

[12/Feb/2023 12:31:51] "POST /media-skip/680dd3de-3e6b-4e40-a82c-6bead3919b7c HTTP/1.1" 302 0
[12/Feb/2023 12:31:51] "GET /media/680dd3de-3e6b-4e40-a82c-6bead3919b7c?message=skipped HTTP/1.1" 200 9613
[12/Feb/2023 12:32:06] "GET /media-skip/680dd3de-3e6b-4e40-a82c-6bead3919b7c HTTP/1.1" 200 6676
2023-02-12 12:32:07,569 [tubesync/INFO] Media: daaaaaaada / _MyJRXfvJmA has a valid publishing date, marking to be unskipped
2023-02-12 12:32:07,574 [tubesync/INFO] Scheduling task to download metadata for: https://www.youtube.com/watch?v=_MyJRXfvJmA

image

image

Am I missing something here?

meeb commented 1 year ago

You are not missing anything. There's an issue with skipping as mentioned in #280 and other issues. When it was first built the skip flag was purely for things like the number of retries and been exceeded and then the media was marked to be permanently skipped internally. This was extended with a UI button that marked media to skip and unskip, however, this is now also managed by various other internal conditions where the skip flag can be reset if you reset some tasks or update a source and some other events (because if you change the source requirements your skipped media may now be able to be downloaded, so it makes sense to unskip the media so it gets retried again in case it is now available).

Really what this needs is a skip flag which is managed internally by tubesync and the downloader, and another manual_skip flag which can be set through the web UI so a single skip flag isn't re-used for both purposes, and both of these states need to be checked when tasks and signals are run.

kuhnchris commented 1 year ago

OK, that makes sense, didn't know about #280, my bad. Your suggestion makes sense tho, I'll try to see if I can add a manual_skip to the Media model and try to find the places to adapt the code accordingly (mostly signal.py and views.py I suppose) - I may have to request a review on the PR from you then, as you do certainly know better if I missed a place or two - keeping you posted. :-)