rj1
about | log | files | refs | license
commit 7e5c0331f9a0293f94077fd954c2a4816e7b1162
parent ef99d26cdc30c86d22f028eb724043cd57599e72
author: rj1 <[email protected]>
date:   Thu,  8 Dec 2022 16:51:44 -0600

added "genres" mode from #1

Diffstat:
Mrofimpd | 17++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/rofimpd b/rofimpd @@ -13,7 +13,7 @@ else fi # modes -modes="current playlist\nplaylists\nshuffle\ntracks\nalbums\nartists" +modes="current playlist\nplaylists\nshuffle\ntracks\nalbums\nartists\ngenres" mode=$(echo -e "$modes" | launcher "mpd: ") # tracks in current playlist @@ -73,4 +73,19 @@ elif [[ "$mode" == "artists" ]]; then mpc clear mpc find artist "$artist" album "$album" | mpc add mpc play + +# list of genres +elif [[ "$mode" == "genres" ]]; then + + # list genres + genre="$(mpc list genre | sort -f | launcher "choose a genre: ")" + [ ! ${genre} ] && exit + + # list albums from chosen genre + album="$(mpc list album genre "${genre}" | launcher "choose album: ")" + [ ! ${album} ] && exit + + mpc clear + mpc find genre "$genre" album "$album" | mpc add + mpc play fi