improvement: only --load-local requires MUSICDIR to be set
This commit is contained in:
@@ -36,7 +36,6 @@ 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
|
||||
@@ -47,7 +46,7 @@ if [ "${MUSICDIR:-}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${1:-}" = "--load-local" ]; then
|
||||
if [ "$MUSICDIR" ] && [ "${1:-}" = "--load-local" ]; then
|
||||
load_local || err "Failed to load local data"
|
||||
exit 0
|
||||
fi
|
||||
@@ -76,7 +75,6 @@ if [ "${MUSICDIR:-}" ]; then
|
||||
echo "Playing recording $2" >>/tmp/foo
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${1:-}" = "--internal-preview-artist" ]; then
|
||||
__preview_artist "$2"
|
||||
|
Reference in New Issue
Block a user