v1.0.91 - New DownloadFolderCleaner Function

Cleanup failed to import albums on each script run...
pull/16/head
RandomNinjaAtk 2 years ago committed by GitHub
parent 215a6acec2
commit 8e622504f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.0.90"
scriptVersion="1.0.91"
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
if [ "$lidarrUrlBase" = "null" ]; then
lidarrUrlBase=""
@ -164,6 +164,18 @@ DownloadFormat () {
fi
}
DownloadFolderCleaner () {
log ":: Removing prevously completed downloads that failed to import..."
# check for completed download folder
if [ -d "/downloads/lidarr-extended/complete" ]; then
# 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
find /downloads/lidarr-extended/complete -mindepth 1 -type d -mtime +1 -exec rm -rf "{}" \; &>/dev/null
fi
fi
}
AddDeezerTopArtists () {
getDeezerArtistsIds=$(curl -s "https://api.deezer.com/chart/0/artists?limit=$1" | jq -r ".data[].id")
getDeezerArtistsIdsCount=$(echo "$getDeezerArtistsIds" | wc -l)
@ -412,6 +424,7 @@ TidalClientSetup () {
}
DownloadProcess () {
downloadedAlbumTitleClean="$(echo "$downloadedAlbumTitle" | sed -e "s%[^[:alpha:][:digit:]._' ]% %g" -e "s/ */ /g" | sed 's/^[.]*//' | sed 's/[.]*$//g' | sed 's/^ *//g' | sed 's/ *$//g')"
if [ ! -d "/downloads/lidarr-extended" ]; then
@ -1384,6 +1397,9 @@ if [ "$configureLidarrWithOptimalSettings" = "true" ]; then
fi
fi
# Perform Completed Download Folder Cleanup process
DownloadFolderCleaner
LidarrRootFolderCheck
DownloadFormat

Loading…
Cancel
Save