From 0a3bd5e928014921d4729e570a518980046bb11d Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Thu, 21 Jan 2021 09:47:00 -0500 Subject: [PATCH] bugfix --- root/scripts/audio-pp.bash | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/root/scripts/audio-pp.bash b/root/scripts/audio-pp.bash index 6998ab3..4c237f1 100644 --- a/root/scripts/audio-pp.bash +++ b/root/scripts/audio-pp.bash @@ -3,6 +3,9 @@ export LC_ALL=C.UTF-8 export LANG=C.UTF-8 TITLESHORT="APP" +set -e +set -o pipefail + Main () { # SETTINGS AudioVerification="${AUDIO_VERIFY}" # TRUE = ENABLED, Verifies FLAC/MP3 files for errors (fixes MP3's, deletes bad FLAC files) @@ -195,24 +198,21 @@ Main () { echo "" trackcount=$(find "$1" -type f -iregex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" | wc -l) echo "Matching $trackcount tracks with Beets" - if [ ! -d /beets ]; then - mkdir -p /beets - fi - if [ -f /beets/library.blb ]; then - rm /beets/library.blb + if [ -f /scripts/library.blb ]; then + rm /scripts/library.blb sleep 0.1 fi - if [ -f /beets/beets.log ]; then - rm /beets/beets.log + if [ -f /scripts/beets/beets.log ]; then + rm /scripts/beets.log sleep 0.1 fi - touch "/beets-match" + touch "/scripts/beets-match" sleep 0.1 if find "$1" -type f -iregex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" | read; then - beet -c /config/scripts/config/beets-config.yaml -l /beets/library.blb -d "$1" import -q "$1" > /dev/null - if find "$1" -type f -iregex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" -newer "/beets-match" | read; then + beet -c /config/scripts/configs/beets-config.yaml -l /scripts/library.blb -d "$1" import -q "$1" > /dev/null + if find "$1" -type f -iregex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" -newer "/scripts/beets-match" | read; then echo "SUCCESS: Matched with beets!" else rm -rf "$1"/* @@ -220,8 +220,8 @@ Main () { fi fi - if [ -f "/beets-match" ]; then - rm "/beets-match" + if [ -f "/scripts/beets-match" ]; then + rm "/scripts/beets-match" sleep 0.1 fi }