tubesync icon indicating copy to clipboard operation
tubesync copied to clipboard

"Delete old media" ignored, media redownloaded after indexing source even though before it was deleted

Open DavidLJz opened this issue 2 years ago • 5 comments

Maybe I fail to understand how the "Delete old media" feature works, but when re-indexing media with the button in the Source listing, media is being downloaded again after it was automatically deleted.

I thought media older than N days should be ignored in future re-indexing and download of media.

DavidLJz avatar Jul 23 '23 07:07 DavidLJz

When you re-index a source it'll use the download cap, you'll probably need to set both the delete old media flag and the download cap to cover your use case.

meeb avatar Jul 23 '23 15:07 meeb

So, as long as I set the DAYS TO KEEP flag to be more than or equal to the DOWNLOAD CAP in days I should be fine, and the media will not be downloaded again, is that correct?

I will try this soon

DavidLJz avatar Jul 23 '23 20:07 DavidLJz

Download cap is the primary field used to determine what is downloaded. The days to keep just runs on a timer and deletes anything older than a set date. For re-indexing the limit will be controlled by the download cap.

meeb avatar Jul 24 '23 07:07 meeb

Problem persists after changing the download cap to be 7 and days to keep as 8. Concretely, TubeSync downloads Media when it can't find files after indexing the source or modifying Source settings, even if it is way older than the Download Cap.

I checked the code and if I'm not mistaken here is where the actual flag checking takes place right before downloading media:

https://github.com/meeb/tubesync/blob/63d32a1e11403fb7bd0c41df5595bb347731dcc7/tubesync/sync/signals.py#L95-L194

In line 128 it sets the media to be skipped if its published date is too old, but it only does this when the media has not already been marked as downloaded (line 105), so its not very useful since it will just keep doing it again.

Hopefully I can come back to this later.

DavidLJz avatar Jul 31 '23 03:07 DavidLJz

I'm not sure I entirely get your point, if the media item is already downloaded why would you want it checked against the download cap which is to check new downloads? There probably are gaps in the download checks and cap logic though.

meeb avatar Aug 01 '23 18:08 meeb

This should have been fixed for a while. Feel free to create an new issue if you still experience this behavior.

meeb avatar Aug 03 '24 10:08 meeb