This commit is contained in:
2025-07-31 10:16:11 +02:00
parent 7eb9d6633f
commit eba10d6322
2 changed files with 22 additions and 13 deletions

View File

@@ -188,7 +188,7 @@ if [ "${1:-}" = "--internal-list-recordings" ]; then
"$AWK_RECORDINGS" | "$AWK_RECORDINGS" |
sort -k1,1n -k 2,2n -r | sort -k1,1n -k 2,2n -r |
cut -d "$(printf '\t')" -f 2- | cut -d "$(printf '\t')" -f 2- |
column -t -s "$(printf '\t')" -R 1,2,4 | column -t -s "$(printf '\t')" -R 1,2,5 |
sed 's| \+\([0-9a-f-]\+\)$|\t\1|' sed 's| \+\([0-9a-f-]\+\)$|\t\1|'
exit 0 exit 0
fi fi
@@ -237,6 +237,7 @@ while true; do
--prompt="$(printf "$ARTIST_PROMPT" "$name")" \ --prompt="$(printf "$ARTIST_PROMPT" "$name")" \
--accept-nth="{2}" \ --accept-nth="{2}" \
--with-nth="{1}" \ --with-nth="{1}" \
--bind="alt-b:execute-silent:xdg-open 'https://musicbrainz.org/release-group/{r2}' &" \
--bind="alt-1:change-query(!$secsymb ),alt-2:change-query($secsymb )" \ --bind="alt-1:change-query(!$secsymb ),alt-2:change-query($secsymb )" \
--bind="ctrl-d:half-page-down,ctrl-u:half-page-up" \ --bind="ctrl-d:half-page-down,ctrl-u:half-page-up" \
--bind="ctrl-r:reload:$0 --internal-list-releasegroups-fresh \"$2\"" --bind="ctrl-r:reload:$0 --internal-list-releasegroups-fresh \"$2\""
@@ -260,22 +261,30 @@ while true; do
--prompt="$(printf "$FULL_PROMPT" "$artist" "$title")" \ --prompt="$(printf "$FULL_PROMPT" "$artist" "$title")" \
--accept-nth="{2}" \ --accept-nth="{2}" \
--with-nth="{1}" \ --with-nth="{1}" \
--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"
) )
[ "$sel" ] && set -- "--show-release" "$sel" [ "$sel" ] && set -- "--show-release" "$sel"
;; ;;
"--show-release") "--show-release")
title="$(mb_release "$2" |
$JQ -r '.title')"
artist="$(mb_release "$2" |
$JQ -r '."artist-credit" | map(([.name, .joinphrase]|join(""))) | join("")')"
sel=$(
$0 --internal-list-recordings "$2" | $0 --internal-list-recordings "$2" |
$FZF \ $FZF \
--ansi \ --ansi \
--reverse \ --reverse \
--cycle \ --cycle \
--no-sort \ --no-sort \
--no-input \
--delimiter="\t" \ --delimiter="\t" \
--prompt="$(printf "$FULL_PROMPT" "$artist" "$title")" \
--accept-nth="{2}" \ --accept-nth="{2}" \
--with-nth="{1}" \ --with-nth="{1}" \
--bind="alt-b:execute-silent:xdg-open 'https://musicbrainz.org/track/{r2}' &" \
--bind="ctrl-d:half-page-down,ctrl-u:half-page-up" --bind="ctrl-d:half-page-down,ctrl-u:half-page-up"
)
exit 0 exit 0
;; ;;
*) *)

View File

@@ -13,7 +13,7 @@ OFF="\033[m"
# Prompts # Prompts
SEARCH_PROMPT=${SEARCH_PROMPT:-"🔎 〉"} SEARCH_PROMPT=${SEARCH_PROMPT:-"🔎 〉"}
ARTIST_PROMPT="${ARTIST_PROMPT:-"🎤 ${CARTIST}%s$OFF"}" ARTIST_PROMPT="${ARTIST_PROMPT:-"🎤 ${CARTIST}%s$OFF"}"
FULL_PROMPT="${FULL_PROMPT:-"🎤 ${CARTIST}%s$OFF » ${CTITLE}%s$OFF"}" FULL_PROMPT="${FULL_PROMPT:-"🎤 ${CARTIST}%s$OFF ${CTITLE}%s$OFF"}"
# Artist view # Artist view
AV_PERSON="${AV_PERSON:-"🧑‍🎤 $CARTIST<<name>>${OFF}"}" AV_PERSON="${AV_PERSON:-"🧑‍🎤 $CARTIST<<name>>${OFF}"}"