RandomNinjaAtk / docker-lidarr-extended

lidarr-extended :: Lidarr application packaged with multiple scripts to provide additional functionality
GNU General Public License v3.0
279 stars 25 forks source link

[Feat]: Queue Cleaner script allow for more time for sync between 2 servers #214

Closed brycelarge closed 1 year ago

brycelarge commented 1 year ago

Hi there,

thanks for all the extrsa features, they really work wonders.

I just wanted to perhaps chat about a possible feature request that delays the cleaner script a little more than 15min.

My setup involves a seedbox that does the downloading and then those files are synced to the lidaar server that does the processing. The issue is when the cleaner script runs the downloads that are currently syncing are removed because lidarr detects there are no files.

I thought of initially extended the time in which the cleaner script runs but that does not entirely eliminate the issue.

I played around with the lidarr api but that does not have any useful information on how long a download has been completed for, still need to play around with transmission api to see if that has anything to use.

Was hoping you might have some insight and ideas on how to accomplish a way to have the cleaner scrip only remove items that have been completed for more than a set time along with any failed or stagnated downloads?

If transmission api has no useful information to use then one idea I have is in the bash script I store a unix time on all completed downloads and then next run it checks if the completed time is greater than a set time and only then remove those.

brycelarge commented 1 year ago

the issue is not as bad in lidarr but far worse with sonnar and radaar, just so happens I added the information to the lidaar project.

RandomNinjaAtk commented 1 year ago

The simplest solution would likely be for you to disable the script and schedule a cron job to execute the script using a specified interval. So you could make it run once daily as an example, or just run the script manually as needed.

A method to track each download (warning) could likely be implemented using temp files and tracking those by file creation time, but it would complicate the script more and could be more error prone.

brycelarge commented 1 year ago

thanks for the advice, I agree that calling it manually is the better solution.