Update BeetsPostProcessor.bash

This commit is contained in:
RandomNinjaAtk 2023-08-18 11:07:34 +00:00 committed by GitHub
parent 4b513a7517
commit e8eaa31706
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,25 +53,25 @@ ProcessWithBeets () {
# Input # Input
# $1 Download Folder to process # $1 Download Folder to process
if [ -f /config/library-postprocessor.blb ]; then if [ -f /config/extended/library-postprocessor.blb ]; then
rm /config/library-postprocessor.blb rm /config/extended/library-postprocessor.blb
sleep 0.5 sleep 0.5
fi fi
if [ -f /config/extended/logs/beets.log ]; then if [ -f /config/extended/extended/logs/beets.log ]; then
rm /config/extended/logs/beets.log rm /config/extended/extended/logs/beets.log
sleep 0.5 sleep 0.5
fi fi
if [ -f "/config/beets-postprocessor-match" ]; then if [ -f "/config/extended/beets-postprocessor-match" ]; then
rm "/config/beets-postprocessor-match" rm "/config/extended/beets-postprocessor-match"
sleep 0.5 sleep 0.5
fi fi
touch "/config/beets-postprocessor-match" touch "/config/extended/beets-postprocessor-match"
sleep 0.5 sleep 0.5
log "$1 :: Being matching with beets!" log "$1 :: Being matching with beets!"
beet -c /config/extended/beets-config.yaml -l /config/library-postprocessor.blb -d "$1" import -qC "$1" beet -c /config/extended/beets-config-postprocessor.yaml -l /config/extended/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/extended/beets-postprocessor-match" | wc -l) -gt 0 ]; then
log "$1 :: SUCCESS :: Matched with beets!" log "$1 :: SUCCESS :: Matched with beets!"
# Fix tags # Fix tags
@ -106,13 +106,13 @@ ProcessWithBeets () {
log "$1 :: ERROR :: Unable to match using beets to a musicbrainz release..." log "$1 :: ERROR :: Unable to match using beets to a musicbrainz release..."
fi fi
if [ -f "/config/beets-postprocessor-match" ]; then if [ -f "/config/extended/beets-postprocessor-match" ]; then
rm "/config/beets-postprocessor-match" rm "/config/extended/beets-postprocessor-match"
sleep 0.5 sleep 0.5
fi fi
if [ -f /config/library-postprocessor.blb ]; then if [ -f /config/extended/library-postprocessor.blb ]; then
rm /config/library-postprocessor.blb rm /config/extended/library-postprocessor.blb
sleep 0.5 sleep 0.5
fi fi
if [ -f /config/extended/logs/beets.log ]; then if [ -f /config/extended/logs/beets.log ]; then