summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2017-09-30 20:58:20 +0200
committerRasmus Steinke <rasi@xssn.at>2017-09-30 20:58:20 +0200
commit349a51ea51a95095d4dabc63b2a4ccee05d62894 (patch)
treeb36551e86123016a407299b4fc3ce647710c15f7 /clerk
parentc28d397b6577cb31f6f60cfcd8163dc80293ab5a (diff)
downloadperl-app-clerk-349a51ea51a95095d4dabc63b2a4ccee05d62894.tar.gz
perl-app-clerk-349a51ea51a95095d4dabc63b2a4ccee05d62894.tar.xz
add option to chose between albumartist or artist for random songs
Diffstat (limited to 'clerk')
-rwxr-xr-xclerk19
1 files changed, 10 insertions, 9 deletions
diff --git a/clerk b/clerk
index cb11299..f4fdef5 100755
--- a/clerk
+++ b/clerk
@@ -57,13 +57,14 @@ sub parse_config {
my $g = $cfg->param(-block=>'General');
%rvar = (%rvar,
- mpd_host => $g->{mpd_host},
- tmux_config => $g->{tmux_config},
- songs => $g->{songs},
- chunksize => $g->{chunksize},
- player => $g->{player},
- tagging => $g->{tagging},
- jump_query => $g->{jump_query}
+ mpd_host => $g->{mpd_host},
+ tmux_config => $g->{tmux_config},
+ songs => $g->{songs},
+ chunksize => $g->{chunksize},
+ player => $g->{player},
+ tagging => $g->{tagging},
+ randomartist => $g->{randomartist},
+ jump_query => $g->{jump_query}
);
my $c = $cfg->param(-block=>'Columns');
@@ -115,7 +116,6 @@ sub parse_options {
'f' => sub { $rvar{backend} = 'fzf'; },
# action
- 'update|u' => $parse_act,
'tracks|t' => $parse_act,
'albums|a' => $parse_act,
'playlists|p' => $parse_act,
@@ -134,6 +134,7 @@ sub parse_options {
$rvar{tmux_ui} = (
$rvar{action} ||
+ $rvar{renewdb} ||
$rvar{instaact} ||
(defined $rvar{tmux_ui} && !$rvar{tmux_ui})
)? 0 : 1;
@@ -306,7 +307,7 @@ sub random_tracks {
mpd_reachable();
$mpd->clear();
for (my $i=0; $i <= $rvar{songs}; $i++) {
- my @artists = $mpd->list('artist');
+ my @artists = $mpd->list($rvar{randomartist});
my $artist_r = $artists[rand @artists];
my @albums = $mpd->list('album', 'artist', $artist_r);
my $album_r = $albums[rand @albums];