v1.1 - fixes
This commit is contained in:
parent
77b1c6b435
commit
d483eb859d
1 changed files with 28 additions and 33 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
scriptVersion="1.0"
|
scriptVersion="1.1"
|
||||||
scriptName="BeetsTagger"
|
scriptName="BeetsTagger"
|
||||||
|
|
||||||
#### Import Settings
|
#### Import Settings
|
||||||
|
@ -69,42 +69,37 @@ ProcessWithBeets () {
|
||||||
touch "/config/extended/beets-lidarr-match"
|
touch "/config/extended/beets-lidarr-match"
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
||||||
log "$1 :: Being matching with beets!"
|
log "$1 :: Begin matching with beets!"
|
||||||
beet -c /config/extended/beets-config-lidarr.yaml -l /config/extended/library-lidarr.blb -d "$1" import -qC "$1"
|
beet -c /config/extended/beets-config-lidarr.yaml -l /config/extended/library-lidarr.blb -d "$1" import -qC "$1"
|
||||||
if [ $(find "$1" -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" -newer "/config/extended/beets-lidarr-match" | wc -l) -gt 0 ]; then
|
# Fix tags
|
||||||
log "$1 :: SUCCESS :: Matched with beets!"
|
log "$1 :: Fixing Tags..."
|
||||||
|
|
||||||
# Fix tags
|
# Fix flac tags
|
||||||
log "$1 :: Fixing Tags..."
|
fixed=0
|
||||||
|
find "$1" -type f -iname "*.flac" -print0 | while IFS= read -r -d '' file; do
|
||||||
# Fix flac tags
|
if [ $fixed == 0 ]; then
|
||||||
fixed=0
|
fixed=$(( $fixed + 1 ))
|
||||||
find "$1" -type f -iname "*.flac" -print0 | while IFS= read -r -d '' file; do
|
log "$1 :: Fixing Flac Tags..."
|
||||||
if [ $fixed == 0 ]; then
|
fi
|
||||||
fixed=$(( $fixed + 1 ))
|
getArtistCredit="$(ffprobe -loglevel 0 -print_format json -show_format -show_streams "$file" | jq -r ".format.tags.ARTIST_CREDIT" | sed "s/null//g" | sed "/^$/d")"
|
||||||
log "$1 :: Fixing Flac Tags..."
|
metaflac --remove-tag=ARTIST "$file"
|
||||||
fi
|
metaflac --remove-tag=ALBUMARTIST "$file"
|
||||||
getArtistCredit="$(ffprobe -loglevel 0 -print_format json -show_format -show_streams "$file" | jq -r ".format.tags.ARTIST_CREDIT" | sed "s/null//g" | sed "/^$/d")"
|
metaflac --remove-tag=ALBUMARTIST_CREDIT "$file"
|
||||||
metaflac --remove-tag=ARTIST "$file"
|
metaflac --remove-tag=ALBUMARTISTSORT "$file"
|
||||||
metaflac --remove-tag=ALBUMARTIST "$file"
|
metaflac --remove-tag=ALBUM_ARTIST "$file"
|
||||||
metaflac --remove-tag=ALBUMARTIST_CREDIT "$file"
|
metaflac --remove-tag="ALBUM ARTIST" "$file"
|
||||||
metaflac --remove-tag=ALBUMARTISTSORT "$file"
|
metaflac --remove-tag=ARTISTSORT "$file"
|
||||||
metaflac --remove-tag=ALBUM_ARTIST "$file"
|
metaflac --remove-tag=COMPOSERSORT "$file"
|
||||||
metaflac --remove-tag="ALBUM ARTIST" "$file"
|
metaflac --set-tag=ALBUMARTIST="$getAlbumArtist" "$file"
|
||||||
metaflac --remove-tag=ARTISTSORT "$file"
|
if [ ! -z "$getArtistCredit" ]; then
|
||||||
metaflac --remove-tag=COMPOSERSORT "$file"
|
metaflac --set-tag=ARTIST="$getArtistCredit" "$file"
|
||||||
metaflac --set-tag=ALBUMARTIST="$getAlbumArtist" "$file"
|
|
||||||
if [ ! -z "$getArtistCredit" ]; then
|
|
||||||
metaflac --set-tag=ARTIST="$getArtistCredit" "$file"
|
|
||||||
else
|
else
|
||||||
metaflac --set-tag=ARTIST="$getAlbumArtist" "$file"
|
metaflac --set-tag=ARTIST="$getAlbumArtist" "$file"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
log "$1 :: Fixing Tags Complete!"
|
log "$1 :: Fixing Tags Complete!"
|
||||||
else
|
|
||||||
log "$1 :: ERROR :: Unable to match using beets to a musicbrainz release..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "/config/extended/beets-lidarr-match" ]; then
|
if [ -f "/config/extended/beets-lidarr-match" ]; then
|
||||||
rm "/config/extended/beets-lidarr-match"
|
rm "/config/extended/beets-lidarr-match"
|
||||||
|
|
Loading…
Reference in a new issue