aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrizen <trizen@protonmail.com>2020-09-12 14:32:40 +0300
committerJesús <heckyel@hyperbola.info>2020-09-14 11:36:44 -0500
commit3f6c02f784b471c4c9dc1be81328798ef8e33054 (patch)
tree9b1f11be08fe563da40ca321e69453437f6d8904
parente13d106d848b43d23b1fadd8d31df7374b1e95d3 (diff)
downloadfair-viewer-3f6c02f784b471c4c9dc1be81328798ef8e33054.tar.lz
fair-viewer-3f6c02f784b471c4c9dc1be81328798ef8e33054.tar.xz
fair-viewer-3f6c02f784b471c4c9dc1be81328798ef8e33054.zip
gtk: fixed the detection of "no results" vs "api down"
Signed-off-by: Jesús <heckyel@hyperbola.info>
-rwxr-xr-xbin/gtk-fair-viewer10
1 files 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;
}