From b3f1b7477fa168651ca2fa7ac50e012440b38f93 Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Fri, 24 Oct 2014 01:26:08 +0200 Subject: outsourced threaded random to own function, removed code --- clerk | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/clerk b/clerk index 3354e36..dd49874 100755 --- a/clerk +++ b/clerk @@ -726,21 +726,21 @@ playRandomAlbum () { } playRandomTracks () { + addRandomT () { + artist="$(mpc list "$mpd_artist" | shuf -n 1)" + album="$(mpc list album "$mpd_artist" "$artist" | shuf -n 1)" + title="$(mpc list title album "$album" "$mpd_artist" "$artist" | shuf -n 1)" + mpc find album "$album" "$mpd_artist" "$artist" title "$title" | mpc add + } mpc clear - artist="$(mpc list "$mpd_artist" | shuf -n 1)" - album="$(mpc list album "$mpd_artist" "$artist" | shuf -n 1)" - title="$(mpc list title album "$album" "$mpd_artist" "$artist" | shuf -n 1)" - mpc find album "$album" "$mpd_artist" "$artist" title "$title" | mpc add + addRandomT mpc play nThreads=4 for (( i=0, j=1; i