From e320434680fe8e72327b1d4d6f05b3a3e2723149 Mon Sep 17 00:00:00 2001 From: trizen Date: Fri, 2 Oct 2020 22:08:23 +0300 Subject: Use the video description from the `description` field when `descriptionHtml` is empty. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jesús --- lib/WWW/FairViewer/Utils.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/WWW') diff --git a/lib/WWW/FairViewer/Utils.pm b/lib/WWW/FairViewer/Utils.pm index 83c4512..bd300b9 100644 --- a/lib/WWW/FairViewer/Utils.pm +++ b/lib/WWW/FairViewer/Utils.pm @@ -501,6 +501,10 @@ sub get_description { $desc = HTML::Entities::decode_entities($desc); $desc =~ s/^\s+//; + if (not $desc =~ /\S/) { + $desc = $info->{description} // ''; + } + ($desc =~ /\S/) ? $desc : 'No description available...'; } -- cgit v1.2.3