summaryrefslogtreecommitdiff
path: root/lib/VNDB/Util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-01-01 17:03:23 +0100
committerYorhel <git@yorhel.nl>2011-01-01 17:03:23 +0100
commit674cab796b2607c1e4441d0005d96588cedbde29 (patch)
treea93fd1754ad0f9124e8eaa6905b81d561e0cf4d5 /lib/VNDB/Util
parentc488ba34c41d6311eb33d1c4ce48c8990bbec24e (diff)
V|R Browse: Don't apply saved filters when an empty filter string is given
Diffstat (limited to 'lib/VNDB/Util')
-rw-r--r--lib/VNDB/Util/Misc.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/VNDB/Util/Misc.pm b/lib/VNDB/Util/Misc.pm
index 6c7acad0..71aca7a8 100644
--- a/lib/VNDB/Util/Misc.pm
+++ b/lib/VNDB/Util/Misc.pm
@@ -18,7 +18,7 @@ my %filfields = (
# Arguments:
# type ('vn' or 'release'),
# filter overwrite (string or undef),
-# when defined and not '', these filters will be used instead of the preferences,
+# when defined, these filters will be used instead of the preferences,
# must point to a variable, will be modified in-place with the actually used filters
# options to pass to db*Get() before the filters (hashref or undef)
# these options can be overwritten by the filters or the next option
@@ -36,11 +36,11 @@ sub filFetchDB {
# simply call the DB if we're not applying filters
return $dbfunc->($self, %$pre, %$post) if !$pref && !$overwrite;
- my $filters = fil_parse $overwrite || $pref, @{$filfields{$type}};
+ my $filters = fil_parse $overwrite // $pref, @{$filfields{$type}};
# compatibility
$self->authPref($prefname => fil_serialize $filters)
- if $type eq 'vn' && _fil_vn_compat($self, $filters) && !$overwrite;
+ if $type eq 'vn' && _fil_vn_compat($self, $filters) && !defined $overwrite;
# write the definite filter string in $overwrite
$_[2] = fil_serialize({map +(
@@ -49,7 +49,7 @@ sub filFetchDB {
exists($pre->{$_}) ? ($_ => $pre->{$_}) : (),
), @{$filfields{$type}}}) if defined $overwrite;
- return $dbfunc->($self, %$pre, %$filters, %$post) if $overwrite;
+ return $dbfunc->($self, %$pre, %$filters, %$post) if defined $overwrite;
# since incorrect filters can throw a database error, we have to special-case
# filters that originate from a preference setting, so that in case these are