summaryrefslogtreecommitdiff
path: root/lib/Multi/API.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2018-10-02 12:54:41 +0200
committerYorhel <git@yorhel.nl>2018-10-02 12:56:38 +0200
commit6bd0b0cd1f3892253d881f71533940f0cf07c13d (patch)
tree852ffd40f3aaa4aea6c04245e71a45ef73a7e372 /lib/Multi/API.pm
parent815f9b1496c75026c9e3ea57bac2f5d5348085ba (diff)
DB: Convert resolution into an enum
Been wanting to do this for a long time - using an integer index into an array that changes once in a while is way too fragile. Doubly so when said indices are also used in filters and URLs that can't be updated every time a new resolution is added.
Diffstat (limited to 'lib/Multi/API.pm')
-rw-r--r--lib/Multi/API.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Multi/API.pm b/lib/Multi/API.pm
index c959539a..585c3d2c 100644
--- a/lib/Multi/API.pm
+++ b/lib/Multi/API.pm
@@ -602,7 +602,7 @@ my %GET_RELEASE = (
$_[0]{minage} = $_[0]{minage} < 0 ? undef : $_[0]{minage}*1;
$_[0]{gtin} ||= undef;
$_[0]{catalog} ||= undef;
- $_[0]{resolution} = $_[0]{resolution} ? $VNDB::S{resolutions}[ $_[0]{resolution} ][0] : undef;
+ $_[0]{resolution} = $_[0]{resolution} eq 'unknown' ? undef : $VNDB::S{resolutions}{ $_[0]{resolution} }[0];
$_[0]{voiced} = $_[0]{voiced} ? $_[0]{voiced}*1 : undef;
$_[0]{animation} = [
$_[0]{ani_story} ? $_[0]{ani_story}*1 : undef,