|
|
@ -1,5 +1,5 @@
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
version=1.0.001
|
|
|
|
version=1.0.002
|
|
|
|
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
|
|
|
@ -38,12 +38,12 @@ getFolderPath="$(dirname "$getTrackPath")"
|
|
|
|
ProcessWithBeets () {
|
|
|
|
ProcessWithBeets () {
|
|
|
|
# Input
|
|
|
|
# Input
|
|
|
|
# $1 Download Folder to process
|
|
|
|
# $1 Download Folder to process
|
|
|
|
if [ -f /scripts/library-postprocessor.blb ]; then
|
|
|
|
if [ -f /config/library-postprocessor.blb ]; then
|
|
|
|
rm /scripts/library-postprocessor.blb
|
|
|
|
rm /config/library-postprocessor.blb
|
|
|
|
sleep 0.1
|
|
|
|
sleep 0.1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -f /scripts/beets-postprocessor.log ]; then
|
|
|
|
if [ -f /config/extended/logs/beets.log ]; then
|
|
|
|
rm /scripts/beets-postprocessor.log
|
|
|
|
rm /config/extended/logs/beets.log
|
|
|
|
sleep 0.1
|
|
|
|
sleep 0.1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ ProcessWithBeets () {
|
|
|
|
sleep 0.1
|
|
|
|
sleep 0.1
|
|
|
|
|
|
|
|
|
|
|
|
log "$1 :: Being matching with beets!"
|
|
|
|
log "$1 :: Being matching with beets!"
|
|
|
|
beet -c /scripts/beets-config.yaml -l /scripts/library.blb -d "$1" import -qC "$1"
|
|
|
|
beet -c /config/extended/scripts/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!"
|
|
|
|
find "$1" -type f -iname "*.flac" -print0 | while IFS= read -r -d '' file; do
|
|
|
|
find "$1" -type f -iname "*.flac" -print0 | while IFS= read -r -d '' file; do
|
|
|
@ -74,6 +74,15 @@ ProcessWithBeets () {
|
|
|
|
rm "/config/beets-postprocessor-match"
|
|
|
|
rm "/config/beets-postprocessor-match"
|
|
|
|
sleep 0.1
|
|
|
|
sleep 0.1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -f /config/library-postprocessor.blb ]; then
|
|
|
|
|
|
|
|
rm /config/library-postprocessor.blb
|
|
|
|
|
|
|
|
sleep 0.1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f /config/extended/logs/beets.log ]; then
|
|
|
|
|
|
|
|
rm /config/extended/logs/beets.log
|
|
|
|
|
|
|
|
sleep 0.1
|
|
|
|
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ProcessWithBeets "$getFolderPath"
|
|
|
|
ProcessWithBeets "$getFolderPath"
|
|
|
|