Skip to content

Commit

Permalink
- Added the "Trending" category in the Gtk2 version.
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Oct 5, 2020
1 parent 25a59c3 commit 6e1d5ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
11 changes: 4 additions & 7 deletions bin/gtk2-youtube-viewer
Expand Up @@ -1781,10 +1781,8 @@ sub append_categories {
}

{
# Standard categories:
add_category_header("Categories");

my $cats = $yv_obj->video_categories();

if (ref($cats) eq 'HASH' and ref($cats->{items}) eq 'ARRAY') {

my $help_text = '';
Expand All @@ -1801,9 +1799,7 @@ sub append_categories {
append_categories($cats, 'cat');
}

# EDU categories:
#add_category_header("EDU Categories");
#append_categories($yv_obj->get_educategories(), 'edu-cat');
append_categories({items => [{snippet => {title => 'Trending', assignable => 1}, id => undef}]}, 'cat');
}

my $tops_liststore = $gui->get_object('liststore6');
Expand Down Expand Up @@ -3018,8 +3014,9 @@ sub play_video {
}

sub list_category {

my $iter = $cat_treeview->get_selection->get_selected;
my $cat_id = $cats_liststore->get($iter, 1) // return;
my $cat_id = $cats_liststore->get($iter, 1);
my $type = $cats_liststore->get($iter, 3);

my $videos =
Expand Down
8 changes: 1 addition & 7 deletions bin/gtk3-youtube-viewer
Expand Up @@ -1872,9 +1872,6 @@ sub append_categories {
}

{
# Standard categories:
add_category_header("Categories");

my $cats = $yv_obj->video_categories();

if (ref($cats) eq 'HASH' and ref($cats->{items}) eq 'ARRAY') {
Expand All @@ -1894,10 +1891,6 @@ sub append_categories {
}

append_categories({items => [{snippet => {title => 'Trending', assignable => 1}, id => undef}]}, 'cat');

# EDU categories:
#add_category_header("EDU Categories");
#append_categories($yv_obj->get_educategories(), 'edu-cat');
}

my $tops_liststore = $gui->get_object('liststore6');
Expand Down Expand Up @@ -3168,6 +3161,7 @@ sub play_video {
}

sub list_category {

my $iter = $cat_treeview->get_selection->get_selected;
my $cat_id = $cats_liststore->get($iter, 1);
my $type = $cats_liststore->get($iter, 3);
Expand Down

0 comments on commit 6e1d5ae

Please sign in to comment.