parent
a0c2a66b33
commit
1ddee1c0aa
1 changed files with 4 additions and 19 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
version=1.0.014
|
version=1.1
|
||||||
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
|
||||||
|
@ -70,7 +70,7 @@ ProcessWithBeets () {
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
||||||
log "$1 :: Being matching with beets!"
|
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
|
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!"
|
log "$1 :: SUCCESS :: Matched with beets!"
|
||||||
|
|
||||||
|
@ -101,21 +101,6 @@ ProcessWithBeets () {
|
||||||
fi
|
fi
|
||||||
done
|
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!"
|
log "$1 :: Fixing Tags Complete!"
|
||||||
else
|
else
|
||||||
log "$1 :: ERROR :: Unable to match using beets to a musicbrainz release..."
|
log "$1 :: ERROR :: Unable to match using beets to a musicbrainz release..."
|
||||||
|
@ -142,7 +127,7 @@ ProcessWithBeets () {
|
||||||
MetadataPostProcess () {
|
MetadataPostProcess () {
|
||||||
# Process item with PlexNotify.bash if plexToken is configured
|
# Process item with PlexNotify.bash if plexToken is configured
|
||||||
log "Using MetadataPostProcess.bash to extract embedded lyrics & artwork...."
|
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
|
if [ ! -z "$plexToken" ]; then
|
||||||
# update plex
|
# update plex
|
||||||
log "$1 :: Using PlexNotify.bash to update Plex...."
|
log "$1 :: Using PlexNotify.bash to update Plex...."
|
||||||
bash /config/extended/scripts/PlexNotify.bash "$2"
|
bash /config/extended/PlexNotify.bash "$2"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue