From 1abd86c66bf47e1730f01311462b4b885b935e25 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 17 Jun 2022 19:01:00 +0000 Subject: [PATCH] v1.0.0024 - New feat: configure standard profile automatically Also, skip auto configure process after the first time it has been run to allow for user modifications --- root/scripts/download.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/root/scripts/download.sh b/root/scripts/download.sh index 1cce890..c6dd0b2 100644 --- a/root/scripts/download.sh +++ b/root/scripts/download.sh @@ -36,7 +36,7 @@ Configuration () { log "" sleep 2 log "############# $dockerTitle" - log "############# SCRIPT VERSION 1.0.0023" + log "############# SCRIPT VERSION 1.0.0024" log "############# DOCKER VERSION $dockerVersion" if [ -z $topLimit ]; then @@ -452,6 +452,13 @@ ConfigureLidarrWithOptimalSettings () { postSettingsToLidarr=$(curl -s "$lidarrUrl/api/v1/rootFolder?" -X POST -H 'Content-Type: application/json' -H "X-Api-Key: ${lidarrApiKey}" --data-raw '{"defaultTags":[],"defaultQualityProfileId":1,"defaultMetadataProfileId":1,"name":"Music","path":"/music"}') fi + log ":: Configuring Lidarr Standard Metadata Profile" + postSettingsToLidarr=$(curl -s "$lidarrUrl/api/v1/metadataprofile/1?" -X PUT -H 'Content-Type: application/json' -H "X-Api-Key: ${lidarrApiKey}" --data-raw '{"name":"Standard","primaryAlbumTypes":[{"albumType":{"id":2,"name":"Single"},"allowed":true},{"albumType":{"id":4,"name":"Other"},"allowed":true},{"albumType":{"id":1,"name":"EP"},"allowed":true},{"albumType":{"id":3,"name":"Broadcast"},"allowed":true},{"albumType":{"id":0,"name":"Album"},"allowed":true}],"secondaryAlbumTypes":[{"albumType":{"id":0,"name":"Studio"},"allowed":true},{"albumType":{"id":3,"name":"Spokenword"},"allowed":true},{"albumType":{"id":2,"name":"Soundtrack"},"allowed":true},{"albumType":{"id":7,"name":"Remix"},"allowed":true},{"albumType":{"id":9,"name":"Mixtape/Street"},"allowed":true},{"albumType":{"id":6,"name":"Live"},"allowed":true},{"albumType":{"id":4,"name":"Interview"},"allowed":true},{"albumType":{"id":8,"name":"DJ-mix"},"allowed":true},{"albumType":{"id":10,"name":"Demo"},"allowed":true},{"albumType":{"id":1,"name":"Compilation"},"allowed":true}],"releaseStatuses":[{"releaseStatus":{"id":3,"name":"Pseudo-Release"},"allowed":false},{"releaseStatus":{"id":1,"name":"Promotion"},"allowed":false},{"releaseStatus":{"id":0,"name":"Official"},"allowed":true},{"releaseStatus":{"id":2,"name":"Bootleg"},"allowed":false}],"id":1}') + + touch /config/logs/autoconfig + chmod 666 /config/logs/autoconfig + chown abc:abc /config/logs/autoconfig + } LidarrRootFolderCheck () { @@ -940,7 +947,13 @@ LidarrTaskStatusCheck () { Configuration if [ "$configureLidarrWithOptimalSettings" = "true" ]; then - ConfigureLidarrWithOptimalSettings + if [ ! -f /config/logs/autoconfig ]; then + ConfigureLidarrWithOptimalSettings + else + log ":: Lidarr previously configured with optimal settings, skipping..." + log ":: To re-configure Lidarr, delete the following file:" + log ":: /config/logs/autoconfig" + fi fi LidarrRootFolderCheck