From 9838963cf2aab02241a37cee7d305025dc694d90 Mon Sep 17 00:00:00 2001 From: trizen Date: Mon, 5 Oct 2020 22:00:21 +0300 Subject: - Implemented support for trending categories. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Example: fair-viewer --trending # trending videos fair-viewer --trending=music # trending music videos fair-viewer -c # list trending categories In the Gtk version, the trending categories are listed in the "Categories" tab. - Several internal code tweaks and improvements. Signed-off-by: Jesús --- lib/WWW/FairViewer/Channels.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/WWW/FairViewer/Channels.pm') diff --git a/lib/WWW/FairViewer/Channels.pm b/lib/WWW/FairViewer/Channels.pm index c554044..3ee44d4 100644 --- a/lib/WWW/FairViewer/Channels.pm +++ b/lib/WWW/FairViewer/Channels.pm @@ -41,6 +41,11 @@ Get the most popular videos for a given channel ID. sub popular_videos { my ($self, $channel_id) = @_; + + if (not defined($channel_id)) { # trending popular videos + return $self->_get_results($self->_make_feed_url('popular')); + } + return $self->_get_results($self->_make_feed_url("channels/$channel_id/videos", sort_by => 'popular')); } -- cgit v1.2.3