From 3f6c02f784b471c4c9dc1be81328798ef8e33054 Mon Sep 17 00:00:00 2001 From: trizen Date: Sat, 12 Sep 2020 14:32:40 +0300 Subject: gtk: fixed the detection of "no results" vs "api down" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jesús --- bin/gtk-fair-viewer | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/gtk-fair-viewer b/bin/gtk-fair-viewer index dcc787b..f8f40d5 100755 --- a/bin/gtk-fair-viewer +++ b/bin/gtk-fair-viewer @@ -2513,10 +2513,6 @@ sub get_pixbuf_thumbnail_from_entry { sub display_results { my ($results, $from_history) = @_; - if (not $yv_utils->has_entries($results)) { - die "No results...\n"; - } - my $url = $results->{url}; #my $info = $results->{results} // {}; my $items = $results->{results} // []; @@ -2533,7 +2529,7 @@ sub display_results { $items = $items->{playlists}; } else { - die "No results...\n"; + warn "No results...\n"; } } @@ -2549,6 +2545,10 @@ sub display_results { . qq{\nSee also: https://libregit.org/heckyel/fair-viewer#invidious-instances\n}; } + if (not $yv_utils->has_entries($results)) { + die "No results...\n"; + } + if (@$items) { add_results_to_history($results) if not $from_history; } -- cgit v1.2.3