diff options
author | Rasmus Steinke <rasi@xssn.at> | 2014-08-16 10:33:28 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2014-08-16 10:33:28 +0200 |
commit | e8663e731b01500f3dd80563eea0d5f62a96060b (patch) | |
tree | 97ece1401e212d883cbadac67856050fb10e8f5b | |
parent | c0890e561e7818bb39cecc8bf3ae65c310283009 (diff) | |
download | perl-app-clerk-e8663e731b01500f3dd80563eea0d5f62a96060b.tar.gz perl-app-clerk-e8663e731b01500f3dd80563eea0d5f62a96060b.tar.xz |
hopefully made random rated tracks function more random
-rwxr-xr-x | clerk | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -676,7 +676,18 @@ loadRandomRatedTracks () { number="$(echo " " | dmenu_t -p "Number of Songs > " | xargs echo)" ratings_min="$(echo " " | dmenu_t -p "Minimum Rating > " | xargs echo)" ratings_max="$(echo " " | dmenu_t -p "Maximum Rating > " | xargs echo)" - for ((i="$ratings_min"; i<="$ratings_max"; i++)); do mpc find comment "$i" | shuf | head -n "$number" | mpc add; done + mpc clear + n=0; while (( n++ < $number )); + do + comment=$(for ((i="$ratings_min"; i<="$ratings_max"; i++)); do echo "$i"; done | shuf -n1) + artist=$(mpc list artist comment "$comment" | shuf -n1) + title=$(mpc list title artist "$artist" comment "$comment" | shuf -n1) + mpc findadd artist "$artist" comment "$comment" title "$title" + done + mpc play +# rating=$(for ((i="$ratings_min"; i<="$ratings_max"; i++)); do mpc find comment "$i" | shuf -n 1) +# title=$(for ((i="$ratings_min"; i<="$ratings_max"; i++)); do mpc list title comment "$i" | shuf -n 1) +# mpc find } |