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
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)

View File

@@ -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"