Merge pull request #153 from Makario1337/main

AutoArtistsAdder doesn't work with multiple rootfolders - Fixes: #120
pull/155/head
RandomNinjaAtk 2 years ago committed by GitHub
commit 6ecd4ef0b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
scriptVersion="1.0.005" scriptVersion="1.0.006"
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
if [ "$lidarrUrlBase" == "null" ]; then if [ "$lidarrUrlBase" == "null" ]; then
@ -121,8 +121,11 @@ AddDeezerArtistToLidarr () {
fi fi
data=$(curl -s "$lidarrUrl/api/v1/rootFolder" -H "X-Api-Key: $lidarrApiKey" | jq -r ".[]") data=$(curl -s "$lidarrUrl/api/v1/rootFolder" -H "X-Api-Key: $lidarrApiKey" | jq -r ".[]")
path="$(echo "$data" | jq -r ".path")" path="$(echo "$data" | jq -r ".path")"
path=$(echo $path | cut -d' ' -f1)
qualityProfileId="$(echo "$data" | jq -r ".defaultQualityProfileId")" qualityProfileId="$(echo "$data" | jq -r ".defaultQualityProfileId")"
qualityProfileId=$(echo $qualityProfileId | cut -d' ' -f1)
metadataProfileId="$(echo "$data" | jq -r ".defaultMetadataProfileId")" metadataProfileId="$(echo "$data" | jq -r ".defaultMetadataProfileId")"
metadataProfileId=$(echo $metadataProfileId | cut -d' ' -f1)
data="{ data="{
\"artistName\": \"$artistName\", \"artistName\": \"$artistName\",
\"foreignArtistId\": \"$foreignId\", \"foreignArtistId\": \"$foreignId\",
@ -133,7 +136,6 @@ AddDeezerArtistToLidarr () {
\"rootFolderPath\": \"$path\", \"rootFolderPath\": \"$path\",
\"addOptions\":{\"searchForMissingAlbums\":$lidarrSearchForMissing} \"addOptions\":{\"searchForMissingAlbums\":$lidarrSearchForMissing}
}" }"
if echo "$lidarrArtistIds" | grep "^${musicbrainz_main_artist_id}$" | read; then if echo "$lidarrArtistIds" | grep "^${musicbrainz_main_artist_id}$" | read; then
log "$currentprocess of $getDeezerArtistsIdsCount :: $deezerArtistName :: Already in Lidarr ($musicbrainz_main_artist_id), skipping..." log "$currentprocess of $getDeezerArtistsIdsCount :: $deezerArtistName :: Already in Lidarr ($musicbrainz_main_artist_id), skipping..."
continue continue
@ -286,8 +288,11 @@ AddTidalArtistToLidarr () {
fi fi
data=$(curl -s "$lidarrUrl/api/v1/rootFolder" -H "X-Api-Key: $lidarrApiKey" | jq -r ".[]") data=$(curl -s "$lidarrUrl/api/v1/rootFolder" -H "X-Api-Key: $lidarrApiKey" | jq -r ".[]")
path="$(echo "$data" | jq -r ".path")" path="$(echo "$data" | jq -r ".path")"
path=$(echo $path | cut -d' ' -f1)
qualityProfileId="$(echo "$data" | jq -r ".defaultQualityProfileId")" qualityProfileId="$(echo "$data" | jq -r ".defaultQualityProfileId")"
qualityProfileId=$(echo $qualityProfileId | cut -d' ' -f1)
metadataProfileId="$(echo "$data" | jq -r ".defaultMetadataProfileId")" metadataProfileId="$(echo "$data" | jq -r ".defaultMetadataProfileId")"
metadataProfileId=$(echo $metadataProfileId | cut -d' ' -f1)
data="{ data="{
\"artistName\": \"$artistName\", \"artistName\": \"$artistName\",
\"foreignArtistId\": \"$foreignId\", \"foreignArtistId\": \"$foreignId\",
@ -298,7 +303,6 @@ AddTidalArtistToLidarr () {
\"rootFolderPath\": \"$path\", \"rootFolderPath\": \"$path\",
\"addOptions\":{\"searchForMissingAlbums\":$lidarrSearchForMissing} \"addOptions\":{\"searchForMissingAlbums\":$lidarrSearchForMissing}
}" }"
if echo "$lidarrArtistIds" | grep "^${musicbrainz_main_artist_id}$" | read; then if echo "$lidarrArtistIds" | grep "^${musicbrainz_main_artist_id}$" | read; then
log "$artistNumber of $lidarrArtistTotal :: $lidarrArtistName :: $currentprocess of $numberOfRelatedArtistsToAddPerArtist :: $serviceArtistName :: Already in Lidarr ($musicbrainz_main_artist_id), skipping..." log "$artistNumber of $lidarrArtistTotal :: $lidarrArtistName :: $currentprocess of $numberOfRelatedArtistsToAddPerArtist :: $serviceArtistName :: Already in Lidarr ($musicbrainz_main_artist_id), skipping..."
continue continue

Loading…
Cancel
Save