Browse Source

fzmp: preview album and track info in artist view

pull/6/head
DanielFGray 4 years ago
parent
commit
da693448f7
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      fzmp

+ 7
- 2
fzmp View File

@@ -97,7 +97,11 @@ filterAllSongs() {

filterByArtist() {
local choice
mapfile -t choice < <(mpc list artist | sort -h | fzf --expect='f1,f3,enter')
mapfile -t choice < <(mpc list artist |
sort -h |
fzf \
--preview='mpc list album artist {}' \
--expect='f1,f3,enter')
(( "${#choice[@]}" > 0 )) || die
case "${choice[0]}" in
'f1') filterAllSongs ;;
@@ -110,9 +114,10 @@ filterByAlbumFromArtist() {
local album artist choice
[[ -z "$1" ]] && filterByArtist
artist="$1"
mapfile -t choice < <(mpc search -f '[(%date%)\t][%album%]' artist "${artist}" |
mapfile -t choice < <(mpc search -f '[(%date%)\t][%album%]' artist "$artist" |
sort -h | uniq |
fzf --prompt="$artist > " \
--preview="album=\$(cut -f2 <<< {}); mpc search -f '[[[%track% - ][%title%]]|%file%]' artist \"$artist\" album \"\$album\"" \
--expect='f1,f3,enter' \
--bind='Ctrl-A:select-all' |
cut -f2)

Loading…
Cancel
Save