Added place holders for sorting playlist, added control documentation.

This commit is contained in:
bluesaxman 2022-10-25 16:21:43 -06:00
parent 03d492c946
commit 8bf9c27b5e

View File

@ -197,6 +197,7 @@ $suggestions->set_binding( sub {
$suggestions->draw();
$wlist->draw();
}, KEY_ENTER);
$suggestions->set_binding( sub {
my $video = $watchlist[0];
unless($video) { return 0; }
@ -213,6 +214,7 @@ $suggestions->set_binding( sub {
$cui->status("PLAYBACK ERROR: Video not removed for safety.");
}
}, "p");
$wlist->set_binding( sub {
my $video = $watchlist[$wlist->get_active_id()];
unless($video) { return 0; }
@ -229,6 +231,7 @@ $wlist->set_binding( sub {
$cui->status("PLAYBACK ERROR: Video not removed for safety.");
}
} , "p");
$suggestions->set_binding( sub {
splice(@videos,0,scalar(@videos));
splice(@suggestArray,0,scalar(@suggestArray));
@ -243,16 +246,32 @@ $suggestions->set_binding( sub {
$suggestions->draw();
$wlist->draw();
}, "r");
$suggestions->set_binding( sub {
my $vid = $videos[$suggestions->get_active_id()];
$cui->status("Video: ".$vid->{title}."\nChannel: ".$vid->{channel}."\nRuntime: ".$vid->{runtime}."\nPublished: ".$vid->{published}."\nURL: https://www.youtube.com/watch?v=".$vid->{id});
}, "i");
$wlist->set_binding( sub {
my $vid = $watchlist[$wlist->get_active_id()];
$cui->status("Video: ".$vid->{title}."\nChannel: ".$vid->{channel}."\nRuntime: ".$vid->{runtime}."\nPublished: ".$vid->{published}."\nURL: https://www.youtube.com/watch?v=".$vid->{id});
} , "i");
$wlist->set_binding( sub {
# Sort shortest to longest
} , "<");
$wlist->set_binding( sub {
# Sort longest to shortest
}, ">");
$suggestions->set_binding( sub {
$cui->status("Controls:\nEnter\tAdd a video to the playlist\np\tPlay currently selected video\ni\tInfo about currently selected video\nr\tRefresh list from youtube\n?\tShow controls");
}, "?");
$wlist->set_binding( sub {
$cui->status("Controls:\n<\tSort from shortest to longest\n>\tSort from longest to shortest\np\tPlay currently selected video\ni\tInfo about currently selected video\n?\tShow controls");
}, "?");
$suggestions->focus();
$cui->mainloop();