diff --git a/root/scripts/download.sh b/root/scripts/download.sh index fae64c9..fc27655 100644 --- a/root/scripts/download.sh +++ b/root/scripts/download.sh @@ -16,6 +16,7 @@ CountryCode=US #addDeezerTopArtists=true #addDeezerTopAlbumArtists=true #addDeezerTopTrackArtists=true +#configureLidarrWithOptimalSettings=true log () { m_time=`date "+%F %T"` @@ -34,7 +35,7 @@ Configuration () { log "" sleep 2 log "############# $dockerTitle" - log "############# SCRIPT VERSION 1.0.0005" + log "############# SCRIPT VERSION 1.0.0006" log "############# DOCKER VERSION $dockerVersion" if [ -z $topLimit ]; then @@ -65,6 +66,13 @@ Configuration () { else log ":: Add Deezer Related Artists is disabled (enable by setting addRelatedArtists=true)" fi + + if [ "$configureLidarrWithOptimalSettings" = "true" ]; then + log ":: Configure Lidarr with optimal settings is enabled" + + else + log ":: Configure Lidarr with optimal settings is disabled (enable by setting configureLidarrWithOptimalSettings=true)" + fi } @@ -378,6 +386,16 @@ DeemixClientSetup () { fi } +ConfigureLidarrWithOptimalSettings () { + + log ":: Configuring Lidarr Track Naming Settings" + postSettingsToLidarr=$(curl -s "$lidarrUrl/api/v1/config/naming" -X PUT -H 'Content-Type: application/json' -H "X-Api-Key: ${lidarrApiKey}" --data-raw '{"renameTracks":true,"replaceIllegalCharacters":true,"standardTrackFormat":"{Artist Name} - {Album Type} - {Release Year} - {Album Title}{ (Album Disambiguation)}/{medium:00}{track:00} - {Track Title}","multiDiscTrackFormat":"{Artist Name} - {Album Type} - {Release Year} - {Album Title}{ (Album Disambiguation)}/{medium:00}{track:00} - {Track Title}","artistFolderFormat":"{Artist Name}{ (Artist Disambiguation)}","includeArtistName":false,"includeAlbumTitle":false,"includeQuality":false,"replaceSpaces":false,"id":1}') + + log ":: Configuring Lidarr Media Management Settings" + postSettingsToLidarr=$(curl -s "$lidarrUrl/api/v1/config/mediamanagement" -X PUT -H 'Content-Type: application/json' -H "X-Api-Key: ${lidarrApiKey}" --data-raw '{"autoUnmonitorPreviouslyDownloadedTracks":false,"recycleBin":"","recycleBinCleanupDays":7,"downloadPropersAndRepacks":"preferAndUpgrade","createEmptyArtistFolders":true,"deleteEmptyFolders":true,"fileDate":"none","watchLibraryForChanges":true,"rescanAfterRefresh":"always","allowFingerprinting":"newFiles","setPermissionsLinux":true,"chmodFolder":"777","chownGroup":"abc","skipFreeSpaceCheckWhenImporting":false,"minimumFreeSpaceWhenImporting":100,"copyUsingHardlinks":true,"importExtraFiles":true,"extraFileExtensions":"jpg,png,lrc","id":1}') + +} + GetMissingCutOffList () { log ":: Downloading missing list..." missingAlbumIds=$(curl -s "$lidarrUrl/api/v1/wanted/missing?page=1&pagesize=1000000000&sortKey=releaseDate&sortDirection=desc&apikey=${lidarrApiKey}" | jq -r '.records | .[] | .id') @@ -832,6 +850,10 @@ LidarrTaskStatusCheck () { Configuration +if [ "$configureLidarrWithOptimalSettings" = "true" ]; then + ConfigureLidarrWithOptimalSettings +fi + if [ "$addDeezerTopArtists" = "true" ]; then AddDeezerTopArtists "$topLimit" fi