improvement: only --load-local requires MUSICDIR to be set

This commit is contained in:
2025-08-25 12:41:46 +02:00
parent 6fef0dcbae
commit 38c7ccea48

View File

@@ -36,7 +36,6 @@ set -eu
. "sh/local.sh" . "sh/local.sh"
# Support of local music files # Support of local music files
if [ "${MUSICDIR:-}" ]; then
if [ "${1:-}" = "--decorate" ]; then if [ "${1:-}" = "--decorate" ]; then
[ ! "${2:-}" ] && err "You did not specify a directory." && exit 1 [ ! "${2:-}" ] && err "You did not specify a directory." && exit 1
[ ! -d "$2" ] && err "Path $2 does not point to a directory." && exit 1 [ ! -d "$2" ] && err "Path $2 does not point to a directory." && exit 1
@@ -47,7 +46,7 @@ if [ "${MUSICDIR:-}" ]; then
exit 0 exit 0
fi fi
if [ "${1:-}" = "--load-local" ]; then if [ "$MUSICDIR" ] && [ "${1:-}" = "--load-local" ]; then
load_local || err "Failed to load local data" load_local || err "Failed to load local data"
exit 0 exit 0
fi fi
@@ -76,7 +75,6 @@ if [ "${MUSICDIR:-}" ]; then
echo "Playing recording $2" >>/tmp/foo echo "Playing recording $2" >>/tmp/foo
exit 0 exit 0
fi fi
fi
if [ "${1:-}" = "--internal-preview-artist" ]; then if [ "${1:-}" = "--internal-preview-artist" ]; then
__preview_artist "$2" __preview_artist "$2"