minor bug fixes

This commit is contained in:
2025-08-25 15:10:56 +02:00
parent b56d691041
commit 58930c75e1
2 changed files with 7 additions and 8 deletions

View File

@@ -46,7 +46,7 @@ if [ "${1:-}" = "--decorate" ]; then
exit 0 exit 0
fi fi
if [ "$MUSICDIR" ] && [ "${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
@@ -483,7 +483,6 @@ while true; do
[ "$lns" -eq 2 ] && [ "$key" = "ctrl-a" ] && set -- "--select-artist" "$(mb_releasegroup "$mid" | $JQ -r '."artist-credit"')" [ "$lns" -eq 2 ] && [ "$key" = "ctrl-a" ] && set -- "--select-artist" "$(mb_releasegroup "$mid" | $JQ -r '."artist-credit"')"
;; ;;
"--releasegroup") "--releasegroup")
set -x
title="$(mb_releasegroup "$2" | title="$(mb_releasegroup "$2" |
$JQ -r '.title')" $JQ -r '.title')"
artist="$(mb_releasegroup "$2" | artist="$(mb_releasegroup "$2" |
@@ -669,7 +668,7 @@ while true; do
--bind="focus:transform:[ {3} ] && echo \"rebind:enter\" || echo \"unbind:enter\"" \ --bind="focus:transform:[ {3} ] && echo \"rebind:enter\" || echo \"unbind:enter\"" \
--bind="ctrl-l:accept" \ --bind="ctrl-l:accept" \
--bind="alt-b:execute-silent:xdg-open 'https://musicbrainz.org/release/{r2}' &" \ --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) lns=$(echo "$sel" | wc -l)
key=$(echo "$sel" | head -1 | tail -1) key=$(echo "$sel" | head -1 | tail -1)
@@ -705,7 +704,7 @@ while true; do
--bind="ctrl-l:accept" \ --bind="ctrl-l:accept" \
--bind="ctrl-d:half-page-down,ctrl-u:half-page-up" \ --bind="ctrl-d:half-page-down,ctrl-u:half-page-up" \
--bind="down:preview-half-page-down,up:preview-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) lns=$(echo "$sel" | wc -l)
key=$(echo "$sel" | head -1 | tail -1) key=$(echo "$sel" | head -1 | tail -1)

View File

@@ -75,17 +75,17 @@ __batch_load_missing() {
while IFS= read -r mbid; do while IFS= read -r mbid; do
case "$1" in case "$1" in
"$TYPE_ARTIST") "$TYPE_ARTIST")
mb_artist "$mbid" >/dev/null name=$(mb_artist "$mbid" | $JQ -r ".name")
;; ;;
"$TYPE_RELEASEGROUP") "$TYPE_RELEASEGROUP")
mb_releasegroup "$mbid" >/dev/null name=$(mb_releasegroup "$mbid" | $JQ -r ".title")
;; ;;
"$TYPE_RELEASE") "$TYPE_RELEASE")
mb_release "$mbid" >/dev/null name=$(mb_release "$mbid" | $JQ -r ".title")
;; ;;
esac esac
cnt=$((cnt + 1)) 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 sleep 1
done <"$tmpf" done <"$tmpf"
printf "\n" printf "\n"