diff options
author | Rasmus Steinke <rasi@xssn.at> | 2014-09-18 11:06:36 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2014-09-18 11:06:36 +0200 |
commit | 207ee6016a9713926ade98b2f316632e6a63fb24 (patch) | |
tree | d5add79219ffe7bc5fbc689cc39c5f33308a9689 | |
parent | 9287cd0f61a15db656563ed69811d2e7ce2db0ae (diff) | |
download | perl-app-clerk-207ee6016a9713926ade98b2f316632e6a63fb24.tar.gz perl-app-clerk-207ee6016a9713926ade98b2f316632e6a63fb24.tar.xz |
added genre browser
-rwxr-xr-x | clerk | 70 |
1 files changed, 62 insertions, 8 deletions
@@ -1268,12 +1268,13 @@ browseLibPrompt() { "---" "1 Browse by Artist" "2 Browse by Date" - "x Browse newest" + "3 Browse by Genre" + "4 Browse latest additions" "---" - "3 Choose Albums" - "4 Choose Track" + "5 Choose Albums" + "6 Choose Track" "---" - "5 Update Album/Track Cache") + "7 Update Album/Track Cache") prompt() { printf "%s\n" "$@" | dmenu_t -p "Library Menu > " @@ -1282,11 +1283,12 @@ browseLibPrompt() { case "$(prompt "${menu[@]}")" in 1*) browseArtist ;; 2*) browseDate ;; - 3*) AddAlbum$quirkAlbum ;; - 4*) AddTrack$quirkTrack ;; - 5*) updateCache && browseLibPrompt ;; + 3*) browseGenre ;; + 5*) AddAlbum$quirkAlbum ;; + 6*) AddTrack$quirkTrack ;; + 7*) updateCache && browseLibPrompt ;; 0*) dplayPrompt ;; - x*) addLastMod ;; + 4*) addLastMod ;; *) exit esac } @@ -1372,6 +1374,58 @@ browseArtist() { fi } + +browseGenre() { + declare -i seen=0 + while read GENRE + do + seen=1 + export GENRE="$GENRE" + if [[ "$GENRE" == "0 Return to Main Menu" ]] + then dplayPrompt + elif [[ "$GENRE" == "Replace All" ]] + then mpc clear && mpc add / && mpc play + elif [[ "$GENRE" == "Add All" ]] + then mpc add / + elif [[ "$GENRE" == "Insert All" ]] + then mpc insert / + else + browseGenre2 + fi + done < <(echo -e "0 Return to Main Menu\n---\nAdd All\nInsert all\nReplace all\n---\n$(mppc list genre)" | dmenu_t -dmenu -p "Choose Genre > ") + + if [[ $seen = 0 ]] + then + exit + fi +} + +browseGenre2() { + declare -i seen=0 + while read ARTIST + do + seen=1 + export GENRE="$ARTIST" + if [[ "$GENRE" == "0 Return to Main Menu" ]] + then dplayPrompt + elif [[ "$ARTIST" == "Replace All" ]] + then mpc clear && mpc add / && mpc play + elif [[ "$ARTIST" == "Add All" ]] + then mpc add / + elif [[ "$ARTIST" == "Insert All" ]] + then mpc insert / + else + browseAlbum + fi + done < <(echo -e "0 Return to Main Menu\n---\nAdd All\nInsert all\nReplace all\n---\n$(mpc list artist genre "$GENRE")" | dmenu_t -dmenu -p "Choose Genre > ") + + if [[ $seen = 0 ]] + then + exit + fi +} + + ################################################################################ |