diff options
author | Yorhel <git@yorhel.nl> | 2022-11-09 11:02:21 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2022-11-09 11:02:23 +0100 |
commit | f6635383ace7d846eb99ed5cbc6c8291ff9f0640 (patch) | |
tree | eac6bdc858b795d43b16e6589d4f0713c9458691 | |
parent | c66c4f40abea997a123975bdb17a69156790d364 (diff) |
Staff::Page: Hide casted characters if VN<->Char relation does not match
This often happens when a character is split into different instances.
The relation is then also removed from the VN page, so this fixes
consistency. It doesn't fix the fact that the VN entry needs to be
updated, some way to alert or find such problems might help.
-rw-r--r-- | lib/VNWeb/Staff/Page.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VNWeb/Staff/Page.pm b/lib/VNWeb/Staff/Page.pm index 4bb55e4a..223d6910 100644 --- a/lib/VNWeb/Staff/Page.pm +++ b/lib/VNWeb/Staff/Page.pm @@ -121,7 +121,7 @@ sub _cast_ { my($s) = @_; my %alias = map +($_->{aid}, $_), $s->{alias}->@*; - my $cast = tuwf->dbAlli(q{ + my $cast = [ grep defined $_->{spoil}, tuwf->dbAlli(q{ SELECT vs.aid, v.id, v.c_released, v.title, v.alttitle, c.id AS cid, c.name AS c_name, c.original AS c_original, vs.note, (SELECT MIN(cv.spoil) FROM chars_vns cv WHERE cv.id = c.id AND cv.vid = v.id) AS spoil FROM vn_seiyuu vs @@ -131,7 +131,7 @@ sub _cast_ { AND NOT v.hidden AND NOT c.hidden ORDER BY v.c_released ASC, v.title ASC - }); + })->@* ]; return if !@$cast; enrich_ulists_widget $cast; |