summaryrefslogtreecommitdiff
path: root/util/jsgen.pl
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 /util/jsgen.pl
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 'util/jsgen.pl')
-rwxr-xr-xutil/jsgen.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/jsgen.pl b/util/jsgen.pl
index 8317f86f..828d090f 100755
--- a/util/jsgen.pl
+++ b/util/jsgen.pl
@@ -18,8 +18,8 @@ sub resolutions {
my $cat = '';
my @r;
my $push = \@r;
- for my $i (0..$#{$S{resolutions}}) {
- my $r = $S{resolutions}[$i];
+ for my $i (keys %{$S{resolutions}}) {
+ my $r = $S{resolutions}{$i};
if($cat ne $r->[1]) {
push @r, [$r->[1]];
$cat = $r->[1];