ctrl-b
This commit is contained in:
33
src/main.sh
33
src/main.sh
@@ -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")
|
||||||
$0 --internal-list-recordings "$2" |
|
title="$(mb_release "$2" |
|
||||||
$FZF \
|
$JQ -r '.title')"
|
||||||
--ansi \
|
artist="$(mb_release "$2" |
|
||||||
--reverse \
|
$JQ -r '."artist-credit" | map(([.name, .joinphrase]|join(""))) | join("")')"
|
||||||
--cycle \
|
sel=$(
|
||||||
--no-sort \
|
$0 --internal-list-recordings "$2" |
|
||||||
--no-input \
|
$FZF \
|
||||||
--delimiter="\t" \
|
--ansi \
|
||||||
--accept-nth="{2}" \
|
--reverse \
|
||||||
--with-nth="{1}" \
|
--cycle \
|
||||||
--bind="ctrl-d:half-page-down,ctrl-u:half-page-up"
|
--no-sort \
|
||||||
|
--delimiter="\t" \
|
||||||
|
--prompt="$(printf "$FULL_PROMPT" "$artist" "$title")" \
|
||||||
|
--accept-nth="{2}" \
|
||||||
|
--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"
|
||||||
|
)
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@@ -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}"}"
|
||||||
|
Reference in New Issue
Block a user