summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-03-02 11:20:48 +0100
committerYorhel <git@yorhel.nl>2021-03-02 11:20:50 +0100
commitb2b1ecc8949d332f8c6e4b4ad1b29215f2c21a8f (patch)
tree7a0eb9fbf7f556e1e27db2cd5972357fc1e4ecf1 /lib
parent69cc222c16d23ccedb49581efae1d9a44498b44e (diff)
Fix two more totally insignificant vndbid sorting bugs
Diffstat (limited to 'lib')
-rw-r--r--lib/VNWeb/Producers/Page.pm2
-rw-r--r--lib/VNWeb/Releases/Page.pm4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/VNWeb/Producers/Page.pm b/lib/VNWeb/Producers/Page.pm
index f95c7489..5fe9a57a 100644
--- a/lib/VNWeb/Producers/Page.pm
+++ b/lib/VNWeb/Producers/Page.pm
@@ -8,7 +8,7 @@ sub enrich_item {
my($p) = @_;
enrich_extlinks p => $p;
enrich_merge pid => 'SELECT id AS pid, name, original FROM producers WHERE id IN', $p->{relations};
- $p->{relations} = [ sort { $a->{name} cmp $b->{name} || $a->{pid} <=> $b->{pid} } $p->{relations}->@* ];
+ $p->{relations} = [ sort { $a->{name} cmp $b->{name} || idcmp($a->{pid}, $b->{pid}) } $p->{relations}->@* ];
}
diff --git a/lib/VNWeb/Releases/Page.pm b/lib/VNWeb/Releases/Page.pm
index 3d97dfe5..0c771a71 100644
--- a/lib/VNWeb/Releases/Page.pm
+++ b/lib/VNWeb/Releases/Page.pm
@@ -11,8 +11,8 @@ sub enrich_item {
$r->{lang} = [ sort map $_->{lang}, $r->{lang}->@* ];
$r->{platforms} = [ sort map $_->{platform}, $r->{platforms}->@* ];
- $r->{vn} = [ sort { $a->{title} cmp $b->{title} || $a->{vid} <=> $b->{vid} } $r->{vn}->@* ];
- $r->{producers} = [ sort { $a->{name} cmp $b->{name} || $a->{pid} <=> $b->{pid} } $r->{producers}->@* ];
+ $r->{vn} = [ sort { $a->{title} cmp $b->{title} || idcmp($a->{vid}, $b->{vid}) } $r->{vn}->@* ];
+ $r->{producers} = [ sort { $a->{name} cmp $b->{name} || idcmp($a->{pid}, $b->{pid}) } $r->{producers}->@* ];
$r->{media} = [ sort { $a->{medium} cmp $b->{medium} || $a->{qty} <=> $b->{qty} } $r->{media}->@* ];
$r->{resolution} = resolution $r;