#45
This commit is contained in:
RandomNinjaAtk 2023-07-29 11:30:38 -04:00 committed by GitHub
parent a0c2a66b33
commit 1ddee1c0aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
version=1.0.014
version=1.1
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
if [ "$lidarrUrlBase" == "null" ]; then
@ -70,7 +70,7 @@ ProcessWithBeets () {
sleep 0.5
log "$1 :: Being matching with beets!"
beet -c /config/extended/scripts/beets-config.yaml -l /config/library-postprocessor.blb -d "$1" import -qC "$1"
beet -c /config/extended/beets-config.yaml -l /config/library-postprocessor.blb -d "$1" import -qC "$1"
if [ $(find "$1" -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" -newer "/config/beets-postprocessor-match" | wc -l) -gt 0 ]; then
log "$1 :: SUCCESS :: Matched with beets!"
@ -101,21 +101,6 @@ ProcessWithBeets () {
fi
done
# Fix opus tags
fixed=0
find "$1" -type f -iname "*.opus" -print0 | while IFS= read -r -d '' file; do
if [ $fixed == 0 ]; then
fixed=$(( $fixed + 1 ))
log "$1 :: Fixing OPUS Tags..."
fi
getArtistCredit="$(ffprobe -loglevel 0 -print_format json -show_format -show_streams "$file" | jq -r ".streams[].tags.ARTIST_CREDIT" 2>/dev/null | sed "s/null//g" | sed "/^$/d")"
if [ ! -z "$getArtistCredit" ]; then
python3 "/config/extended/scripts/tag_opus.py" --file "$file" --songartist "$getArtistCredit" --songalbumartist "$getAlbumArtist"
else
python3 "/config/extended/scripts/tag_opus.py" --file "$file" --songartist "$getAlbumArtist" --songalbumartist "$getAlbumArtist"
fi
done
log "$1 :: Fixing Tags Complete!"
else
log "$1 :: ERROR :: Unable to match using beets to a musicbrainz release..."
@ -142,7 +127,7 @@ ProcessWithBeets () {
MetadataPostProcess () {
# Process item with PlexNotify.bash if plexToken is configured
log "Using MetadataPostProcess.bash to extract embedded lyrics & artwork...."
bash /config/extended/scripts/MetadataPostProcess.bash "$1"
bash /config/extended/MetadataPostProcess.bash "$1"
}
@ -151,7 +136,7 @@ NotifyPlex () {
if [ ! -z "$plexToken" ]; then
# update plex
log "$1 :: Using PlexNotify.bash to update Plex...."
bash /config/extended/scripts/PlexNotify.bash "$2"
bash /config/extended/PlexNotify.bash "$2"
fi
}