Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
In video information, hide fields that do not have a value. (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed May 30, 2020
1 parent 666d50a commit 9594278
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/straw-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -3529,7 +3529,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)],
Expand All @@ -3538,7 +3540,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)],
)),
Expand Down

0 comments on commit 9594278

Please sign in to comment.