Rename ERA + Removing previous downloads from logs

pull/157/head
Makario1337 2 years ago committed by GitHub
parent 870d6e17e6
commit d9f57dbe9f
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.1.2" scriptVersion="1.1.3"
agent="ERA ( https://github.com/Makario1337/ExtendedReleaseAdder )" agent="ERA ( https://github.com/Makario1337/ExtendedReleaseAdder )"
### DEBUG ### ### DEBUG ###
@ -69,8 +69,8 @@ AddReleaseToLidarr() {
sed 's/"qualityProfileId": 0/"qualityProfileId": 1/g' | sed 's/"qualityProfileId": 0/"qualityProfileId": 1/g' |
sed 's/"metadataProfileId": 0/"metadataProfileId": 1/g' | sed 's/"metadataProfileId": 0/"metadataProfileId": 1/g' |
sed "s%\"metadataProfileId\": 1%\"metadataProfileId\": 1,\"rootFolderPath\": \"\" %g" | sed "s%\"metadataProfileId\": 1%\"metadataProfileId\": 1,\"rootFolderPath\": \"\" %g" |
sed 's/"metadataProfileId": 1/"metadataProfileId": 1,\"addOptions": {"monitor": "all","searchForMissingAlbums": false}/g' | sed 's/"metadataProfileId": 1/"metadataProfileId": 1,\"addOptions": {"monitor": "all","searchForMissingAlbums": true}/g' |
sed 's/"grabbed": false/"grabbed": false,\"addOptions": {"searchForNewAlbum": false}/g'| sed 's/"grabbed": false/"grabbed": false,\"addOptions": {"searchForNewAlbum": true}/g'|
jq '.' | jq '.' |
cut -c 2- | cut -c 2- |
head -c -2) head -c -2)
@ -128,7 +128,6 @@ for artist in ${ERAArtistsList[@]}; do
trim=$(echo $line | cut -c 2- | head -c -2) trim=$(echo $line | cut -c 2- | head -c -2)
ReleaseName=$(wget -U "$agent" --timeout=0 -q -O - "https://musicbrainz.org/ws/2/release-group/$trim" | grep -o "<title>.*</title>" | sed 's/<title>//g' | head -c -9) ReleaseName=$(wget -U "$agent" --timeout=0 -q -O - "https://musicbrainz.org/ws/2/release-group/$trim" | grep -o "<title>.*</title>" | sed 's/<title>//g' | head -c -9)
AddReleaseToLidarr $trim "$artistname" "$ReleaseName" AddReleaseToLidarr $trim "$artistname" "$ReleaseName"
sleep 1.5
done done
fi fi
done done
@ -143,9 +142,18 @@ RefreshArtists() {
done done
} }
CleanPreviousDownloads() {
for artist in ${ERAArtistsList[@]}; do
log "cleaning $artist"
find /config/extended/logs/notfound -type f -name '*$(echo $artist | tail -c +2 | head -c -2 )*' -delete
done
}
SearchAllArtistsByTag SearchAllArtistsByTag
CheckIfCollectedArtistsAreInLidarrInstance CheckIfCollectedArtistsAreInLidarrInstance
ArtistLookupAndCallAddReleaseToLidarr ArtistLookupAndCallAddReleaseToLidarr
CleanPreviousDownloads
RefreshArtists RefreshArtists
log "DONE :: Finishing..." log "DONE :: Finishing..."
exit exit
Loading…
Cancel
Save