diff options
author | trizen <trizen@protonmail.com> | 2020-05-30 11:41:04 +0300 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-06-06 21:49:15 -0500 |
commit | 99ccfc9f20f89f0034da5647a3b8abfb5fa5387d (patch) | |
tree | 9cc012d5d1ad1530a878c049c3ced13969d15791 | |
parent | eeceb1be49701ddc80700bb39402320bb7a172f3 (diff) | |
download | fair-viewer-99ccfc9f20f89f0034da5647a3b8abfb5fa5387d.tar.lz fair-viewer-99ccfc9f20f89f0034da5647a3b8abfb5fa5387d.tar.xz fair-viewer-99ccfc9f20f89f0034da5647a3b8abfb5fa5387d.zip |
In video information, hide fields that do not have a value. (https://github.com/trizen/straw-viewer/issues/13)
Signed-off-by: Jesús <heckyel@hyperbola.info>
-rwxr-xr-x | bin/fair-viewer | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/fair-viewer b/bin/fair-viewer index 3d2659e..85244a3 100755 --- a/bin/fair-viewer +++ b/bin/fair-viewer @@ -3532,7 +3532,9 @@ sub print_video_info { print "\n$hr\n", q{ } x $rep => (_bold_color("=>> $title <<=") . "\n\n"), map(sprintf(q{-> } . "%-*s: %s\n", $opt{_colors} ? 18 : 10, _bold_color($_->[0]), $_->[1]), - ( + grep { + defined($_->[1]) and $_->[1] !~ /^(0|unknown)\z/i + } ( ['Channel' => $yv_utils->get_channel_title($video)], ['ChannelID' => $yv_utils->get_channel_id($video)], ['VideoID' => $yv_utils->get_video_id($video)], @@ -3541,7 +3543,6 @@ sub print_video_info { ['Duration' => $yv_utils->get_time($video)], ['Likes' => $yv_utils->set_thousands($yv_utils->get_likes($video))], ['Dislikes' => $yv_utils->set_thousands($yv_utils->get_dislikes($video))], - ['Comments' => $yv_utils->set_thousands($yv_utils->get_comments($video))], ['Views' => $yv_utils->set_thousands($yv_utils->get_views($video))], ['Published' => $yv_utils->get_publication_date($video)], )), |