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,46 +36,44 @@ set -eu
. "sh/local.sh"
# Support of local music files
if [ "${MUSICDIR:-}" ]; then
if [ "${1:-}" = "--decorate" ]; then
[ ! "${2:-}" ] && err "You did not specify a directory." && exit 1
[ ! -d "$2" ] && err "Path $2 does not point to a directory." && exit 1
if ! decorate "$2"; then
err "Something went wrong. Are you're files tagged correctly?"
exit 1
fi
exit 0
if [ "${1:-}" = "--decorate" ]; then
[ ! "${2:-}" ] && err "You did not specify a directory." && exit 1
[ ! -d "$2" ] && err "Path $2 does not point to a directory." && exit 1
if ! decorate "$2"; then
err "Something went wrong. Are you're files tagged correctly?"
exit 1
fi
exit 0
fi
if [ "${1:-}" = "--load-local" ]; then
load_local || err "Failed to load local data"
exit 0
fi
if [ "$MUSICDIR" ] && [ "${1:-}" = "--load-local" ]; then
load_local || err "Failed to load local data"
exit 0
fi
if [ "${1:-}" = "--list-releases" ]; then
list_releases
exit 0
fi
if [ "${1:-}" = "--list-releases" ]; then
list_releases
exit 0
fi
if [ "${1:-}" = "--list-releasegroups" ]; then
list_releasegroups
exit 0
fi
if [ "${1:-}" = "--list-releasegroups" ]; then
list_releasegroups
exit 0
fi
if [ "${1:-}" = "--list-artists" ]; then
list_artists
exit 0
fi
if [ "${1:-}" = "--list-artists" ]; then
list_artists
exit 0
fi
if [ "${1:-}" = "--play-release" ]; then
echo "Playing release $2" >>/tmp/foo
exit 0
fi
if [ "${1:-}" = "--play-release" ]; then
echo "Playing release $2" >>/tmp/foo
exit 0
fi
if [ "${1:-}" = "--play-recording" ]; then
echo "Playing recording $2" >>/tmp/foo
exit 0
fi
if [ "${1:-}" = "--play-recording" ]; then
echo "Playing recording $2" >>/tmp/foo
exit 0
fi
if [ "${1:-}" = "--internal-preview-artist" ]; then