v1.0.1 - Only run one time to prevent resetting settings

pull/139/head
RandomNinjaAtk 2 years ago committed by GitHub
parent 20987235fb
commit bfc8e131d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.0.0"
scriptVersion="1.0.1"
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
@ -27,6 +27,13 @@ log () {
}
if [ -f /config/extended/logs/autoconfig ]; then
log "Lidarr previously configured with optimal settings, skipping..."
log "To re-configure Lidarr, delete the following file:"
log "/config/extended/logs/autoconfig"
exit
fi
if curl -s "$lidarrUrl/api/v1/rootFolder" -H "X-Api-Key: ${lidarrApiKey}" | sed '1q' | grep "\[\]" | read; then
log "ERROR :: No root folder found"
log "Configuring root folder..."
@ -75,4 +82,7 @@ postSettingsToLidarr=$(curl -s "$lidarrUrl/api/v1/config/naming" -X PUT -H 'Cont
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 CleanName} - {Album Type} - {Release Year} - {Album CleanTitle}{ (Album Disambiguation)}/{medium:00}{track:00} - {Track CleanTitle}","multiDiscTrackFormat":"{Artist CleanName} - {Album Type} - {Release Year} - {Album CleanTitle}{ (Album Disambiguation)}/{medium:00}{track:00} - {Track CleanTitle}","artistFolderFormat":"{Artist CleanName}{ (Artist Disambiguation)}","includeArtistName":false,"includeAlbumTitle":false,"includeQuality":false,"replaceSpaces":false,"id":1}')
exit
touch /config/extended/logs/autoconfig
chmod 666 /config/extended/logs/autoconfig
exit

Loading…
Cancel
Save