recordings
This commit is contained in:
40
src/main.sh
40
src/main.sh
@@ -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 "" |
|
||||
|
Reference in New Issue
Block a user