diff --git a/src/main.sh b/src/main.sh index 337acfd..c16f0b8 100755 --- a/src/main.sh +++ b/src/main.sh @@ -136,13 +136,14 @@ fi while true; do case "${1:-}" in "--show-artist") + name=$(mb_artist "$2" | $JQ -r '.name') sel=$( $0 --internal-list-releases "$2" | $FZF \ --ansi \ --reverse \ --delimiter="\t" \ - --prompt="$(printf "$ARTIST_PROMPT" "$3")" \ + --prompt="$(printf "$ARTIST_PROMPT" "$name")" \ --accept-nth="{2}" \ --with-nth="{1}" ) @@ -158,13 +159,13 @@ while true; do --disabled \ --delimiter="\t" \ --prompt="$SEARCH_PROMPT" \ - --accept-nth="{1} {2}" \ + --accept-nth="{1}" \ --with-nth="{2}" \ --preview-window="wrap" \ --preview="$0 --internal-preview-artist {1}" \ --bind="change:execute-silent($0 --internal-search \$FZF_QUERY &)+reload($0 --internal-reload)" ) - [ "$sel" ] && set -- "--show-artist" "$(echo "$sel" | cut -d " " -f 1)" "$(echo "$sel" | cut -d " " -f2-)" + [ "$sel" ] && set -- "--show-artist" "$sel" ;; esac done diff --git a/src/sh/mb.sh b/src/sh/mb.sh index 858ee96..d011144 100644 --- a/src/sh/mb.sh +++ b/src/sh/mb.sh @@ -52,5 +52,5 @@ mb_artist_enwikipedia() { __api_wikipedia_en_get_summary "$wikiid" | cache_put_artist_enwikipedia "$1" enwiki="$(cache_get_artist_enwikipedia "$1")" fi - echo "$enwiki" + [ ! "$enwiki" ] || [ "$enwiki" != "null" ] || return }