recordings

This commit is contained in:
2025-07-31 08:55:25 +02:00
parent 64afff2110
commit 7eb9d6633f
4 changed files with 81 additions and 1 deletions

View File

@@ -169,6 +169,30 @@ if [ "${1:-}" = "--internal-list-releases" ]; then
exit 0
fi
if [ "${1:-}" = "--internal-list-recordings" ]; then
mb_release "$2" |
$JQ -r '.media[] |
.position as $pos |
.tracks[] | [
.id,
$pos,
.number,
.length,
.recording.title,
(.recording."artist-credit" | map([.name, .joinphrase] | join("")) | join(""))
] |
join("\t")' |
awk \
-F "\t" \
-v format="$REC_FORMAT" \
"$AWK_RECORDINGS" |
sort -k1,1n -k 2,2n -r |
cut -d "$(printf '\t')" -f 2- |
column -t -s "$(printf '\t')" -R 1,2,4 |
sed 's| \+\([0-9a-f-]\+\)$|\t\1|'
exit 0
fi
if [ "${1:-}" = "--help" ]; then
cat <<EOF
Usage: $0 [ --help | --show-artist <mbid> ]
@@ -207,6 +231,7 @@ while true; do
--ansi \
--reverse \
--cycle \
--no-sort \
--query="!$secsymb " \
--delimiter="\t" \
--prompt="$(printf "$ARTIST_PROMPT" "$name")" \
@@ -237,9 +262,22 @@ while true; do
--with-nth="{1}" \
--bind="ctrl-d:half-page-down,ctrl-u:half-page-up"
)
exit 0
[ "$sel" ] && set -- "--show-release" "$sel"
;;
"--show-release")
$0 --internal-list-recordings "$2" |
$FZF \
--ansi \
--reverse \
--cycle \
--no-sort \
--no-input \
--delimiter="\t" \
--accept-nth="{2}" \
--with-nth="{1}" \
--bind="ctrl-d:half-page-down,ctrl-u:half-page-up"
exit 0
;;
*)
sel=$(
printf "" |