From 58930c75e1041a0a767d30b49fb68ebd16fd17d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=84min=20Baumeler?= Date: Mon, 25 Aug 2025 15:10:56 +0200 Subject: [PATCH] minor bug fixes --- src/main.sh | 7 +++---- src/sh/local.sh | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.sh b/src/main.sh index 75b62be..f01279c 100755 --- a/src/main.sh +++ b/src/main.sh @@ -46,7 +46,7 @@ if [ "${1:-}" = "--decorate" ]; then exit 0 fi -if [ "$MUSICDIR" ] && [ "${1:-}" = "--load-local" ]; then +if [ "${MUSICDIR:-}" ] && [ "${1:-}" = "--load-local" ]; then load_local || err "Failed to load local data" exit 0 fi @@ -483,7 +483,6 @@ while true; do [ "$lns" -eq 2 ] && [ "$key" = "ctrl-a" ] && set -- "--select-artist" "$(mb_releasegroup "$mid" | $JQ -r '."artist-credit"')" ;; "--releasegroup") - set -x title="$(mb_releasegroup "$2" | $JQ -r '.title')" artist="$(mb_releasegroup "$2" | @@ -669,7 +668,7 @@ while true; do --bind="focus:transform:[ {3} ] && echo \"rebind:enter\" || echo \"unbind:enter\"" \ --bind="ctrl-l:accept" \ --bind="alt-b:execute-silent:xdg-open 'https://musicbrainz.org/release/{r2}' &" \ - --bind="ctrl-d:half-page-down,ctrl-u:half-page-up" + --bind="ctrl-d:half-page-down,ctrl-u:half-page-up" || true ) lns=$(echo "$sel" | wc -l) key=$(echo "$sel" | head -1 | tail -1) @@ -705,7 +704,7 @@ while true; do --bind="ctrl-l:accept" \ --bind="ctrl-d:half-page-down,ctrl-u:half-page-up" \ --bind="down:preview-half-page-down,up:preview-half-page-up" \ - --bind="alt-b:execute-silent:xdg-open 'https://musicbrainz.org/artist/{r2}' &" + --bind="alt-b:execute-silent:xdg-open 'https://musicbrainz.org/artist/{r2}' &" || true ) lns=$(echo "$sel" | wc -l) key=$(echo "$sel" | head -1 | tail -1) diff --git a/src/sh/local.sh b/src/sh/local.sh index cd6ec5b..0cc18af 100644 --- a/src/sh/local.sh +++ b/src/sh/local.sh @@ -75,17 +75,17 @@ __batch_load_missing() { while IFS= read -r mbid; do case "$1" in "$TYPE_ARTIST") - mb_artist "$mbid" >/dev/null + name=$(mb_artist "$mbid" | $JQ -r ".name") ;; "$TYPE_RELEASEGROUP") - mb_releasegroup "$mbid" >/dev/null + name=$(mb_releasegroup "$mbid" | $JQ -r ".title") ;; "$TYPE_RELEASE") - mb_release "$mbid" >/dev/null + name=$(mb_release "$mbid" | $JQ -r ".title") ;; esac cnt=$((cnt + 1)) - printf "\033[K\r%d/%d (%s: %s)" "$cnt" "$lines" "$mbid" "$($JQ -r ".name // .title")" + printf "\033[2K\r%d/%d (%s: %s)" "$cnt" "$lines" "$mbid" "$name" sleep 1 done <"$tmpf" printf "\n"