Closed endkb closed 2 weeks ago
Things would get complicated because you'd want rclone to sync if it cleaned up even if it didn't download anything. Sync would be easy. If rclone is just copying, like with Internet Archive, that would be harder.
Need a way to detect whether rclone is syncing or copying.
The problem will be detecting whether rclone needs to copy AND that there's something to copy. If it didn't successfully download the file, then it shouldn't try to copy.
The rclone --check-first
command might be good to look in to.
Can't really test it until Internet Archive comes back online.
Made and tested a whole bunch of changes to the way it detects whether rclone needs to run and the way script blocks run.
Right now SoundsDownloadScript only runs the cleanup routine if it successfully downloads a new audio file. That's fine if it's keeping the last X new episodes, but doesn't make sense if
-Days
parameter is set.Could move the cleanup routine to it's own function called
Invoke-MediaCleanupRoutine
and call it before the script exits.I don't know if it makes sense to do that.