diff options
author | Rasmus Steinke <rasi@xssn.at> | 2017-09-21 22:18:08 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2017-09-21 22:18:08 +0200 |
commit | 4a03ed7a11863b53597cd80bfd3f0613a3e8f82b (patch) | |
tree | 5a1de2410408c08dfe858f8625bcd204e7fefbb2 /clerk | |
parent | 67d61ea59a8e2e67e7e9a7b47782461da51a4dca (diff) | |
download | perl-app-clerk-4a03ed7a11863b53597cd80bfd3f0613a3e8f82b.tar.gz perl-app-clerk-4a03ed7a11863b53597cd80bfd3f0613a3e8f82b.tar.xz |
only show rate option for track listing
Diffstat (limited to 'clerk')
-rwxr-xr-x | clerk | 22 |
1 files changed, 19 insertions, 3 deletions
@@ -353,7 +353,7 @@ sub do_action { $mpd->rm("$in"); } } - } elsif ($context eq "tracks") { + } elsif ($context eq "Tracks") { my @action_items = ("Add\n", "Replace\n", "Rate Track\n"); $action = backend_call(\@action_items); if ($action eq "Replace\n") { @@ -383,6 +383,22 @@ sub do_action { if ($action eq "Replace\n") { $mpd->play(); } + } elsif ($context eq "Albums" || $context eq "Latest") { + my @action_items = ("Add\n", "Replace\n"); + $action = backend_call(\@action_items); + if ($action eq "Replace\n") { + $mpd->clear(); + } + my $input; + foreach my $line (split /\n/, $in) { + my $uri = (split /[\t\n]/, $line)[-1]; + $uri = decode('UTF-8', $uri ); + $mpd->add($uri); + system(@queue_cmd); + } + if ($action eq "Replace\n") { + $mpd->play(); + } } } @@ -488,14 +504,14 @@ sub list_db_entries_for { my $output = $formater{$kind}->($rdb); if ($backend eq "rofi") { my $out = backend_call($output, $fields{$kind}); - do_action($out, "tracks", "ignore"); + do_action($out, $kind, "ignore"); } elsif ($backend eq "fzf") { for (;;) { create_db(); my $out = backend_call($output, $fields{$kind}); try { - do_action($out, "tracks", "ignore"); + do_action($out, $kind, "ignore"); if($kind eq "Ratings") { system('tmux', 'kill-pane'); } |