summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Releases
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-02-28 12:53:44 +0100
committerYorhel <git@yorhel.nl>2020-02-28 12:55:40 +0100
commitccc121634fec7d7aa3a36564eeab2330e543e970 (patch)
treee427f45ceeda01c55260950e2844b22548735586 /lib/VNWeb/Releases
parent03106135b8d4f0c2c0387991133cc3205957d68b (diff)
v2rw/RelEdit: Add producers relation editing
Lots of copy-pasting going on here. Meh. Also added a couple of overdue server-side validations.
Diffstat (limited to 'lib/VNWeb/Releases')
-rw-r--r--lib/VNWeb/Releases/Edit.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/VNWeb/Releases/Edit.pm b/lib/VNWeb/Releases/Edit.pm
index 21563c34..a292261d 100644
--- a/lib/VNWeb/Releases/Edit.pm
+++ b/lib/VNWeb/Releases/Edit.pm
@@ -34,6 +34,12 @@ my $FORM = {
vid => { id => 1 },
title => { _when => 'out' },
} },
+ producers => { sort_keys => 'pid', aoh => {
+ pid => { id => 1 },
+ developer => { anybool => 1 },
+ publisher => { anybool => 1 },
+ name => { _when => 'out' },
+ } },
hidden => { anybool => 1 },
locked => { anybool => 1 },
@@ -67,6 +73,7 @@ TUWF::get qr{/$RE{rrev}/(?<action>edit|copy)} => sub {
to_extlinks $e;
enrich_merge vid => 'SELECT id AS vid, title FROM vn WHERE id IN', $e->{vn};
+ enrich_merge pid => 'SELECT id AS pid, name FROM producers WHERE id IN', $e->{producers};
my $title = ($copy ? 'Copy ' : 'Edit ').$e->{title};
framework_ title => $title, type => 'r', dbobj => $e, tab => tuwf->capture('action'),
@@ -98,7 +105,12 @@ elm_api ReleaseEdit => $FORM_OUT, $FORM_IN, sub {
$data->{hidden} = $e->{hidden}||0;
$data->{locked} = $e->{locked}||0;
}
+ $data->{doujin} = $data->{voiced} = $data->{ani_story} = $data->{ani_ero} = 0 if $data->{patch};
+ $data->{resolution} = 'unknown' if $data->{patch};
+ $data->{uncensored} = 0 if $data->{minage} != 18;
$_->{qty} = $MEDIUM{$_->{medium}}{qty} ? $_->{qty}||1 : 0 for $data->{media}->@*;
+ $data->{notes} = bb_subst_links $data->{notes};
+ die "No VNs selected" if !$data->{vn}->@*;
to_extlinks $e;
$e->{rtype} = delete $e->{type};