From c9ed88bbe59c2c7a8b0e0ddc3f2da948b7ba7a0e Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 8 Jul 2022 13:41:27 +0000 Subject: [PATCH] v1.0.99 - new NotFoundFolderCleaner process Retry searching for notfound albums every 7 days... --- root/scripts/download.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/root/scripts/download.sh b/root/scripts/download.sh index e9e0df9..87516f4 100644 --- a/root/scripts/download.sh +++ b/root/scripts/download.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.98" +scriptVersion="1.0.99" lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" if [ "$lidarrUrlBase" = "null" ]; then lidarrUrlBase="" @@ -165,9 +165,9 @@ DownloadFormat () { } DownloadFolderCleaner () { - log ":: Removing prevously completed downloads that failed to import..." # check for completed download folder if [ -d "/downloads/lidarr-extended/complete" ]; then + log ":: Removing prevously completed downloads that failed to import..." # check for completed downloads older than 1 day if find /downloads/lidarr-extended/complete -mindepth 1 -type d -mtime +1 | read; then # delete completed downloads older than 1 day, these most likely failed to import due to Lidarr failing to match @@ -176,6 +176,18 @@ DownloadFolderCleaner () { fi } +NotFoundFolderCleaner () { + # check for completed download folder + if [ -d /config/extended/logs/downloaded/notfound ]; then + log ":: Removing prevously notfound lidarr album ids older than 7 days to give them a retry..." + # check for notfound entries older than 7 days + if find /config/extended/logs/downloaded/notfound -mindepth 1 -type f -mtime +7 | read; then + # delete ntofound entries older than 7 days + find /config/extended/logs/downloaded/notfound -mindepth 1 -type f -mtime +7 -delete + fi + fi +} + AddDeezerTopArtists () { getDeezerArtistsIds=$(curl -s "https://api.deezer.com/chart/0/artists?limit=$1" | jq -r ".data[].id") getDeezerArtistsIdsCount=$(echo "$getDeezerArtistsIds" | wc -l) @@ -1494,6 +1506,9 @@ fi # Perform Completed Download Folder Cleanup process DownloadFolderCleaner +# Perform NotFound Folder Cleanup process +NotFoundFolderCleaner + LidarrRootFolderCheck DownloadFormat