summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-07-09 14:31:59 +0200
committerYorhel <git@yorhel.nl>2020-07-09 14:32:00 +0200
commitc6596cef2d298a7d2f2e37d2939e7a5df3abd4fc (patch)
tree4766cf571bcbcc8ecda9a425d7a5d4f76e6674ed /lib
parent8d7bfc3c169e112744fe6d3bd49b4fcbcb603959 (diff)
VN::Page: Select highest available flagging option for screenshots
Otherwise it appears as if no option has been selected at all.
Diffstat (limited to 'lib')
-rw-r--r--lib/VNWeb/VN/Page.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/VNWeb/VN/Page.pm b/lib/VNWeb/VN/Page.pm
index e7524e82..8e6b6540 100644
--- a/lib/VNWeb/VN/Page.pm
+++ b/lib/VNWeb/VN/Page.pm
@@ -617,6 +617,8 @@ sub screenshots_ {
my $sexp = auth->pref('max_sexual')||0;
my $viop = auth->pref('max_violence')||0;
$viop = 0 if $sexp < 0;
+ my $sexs = min($sexp, max map $_->{scr}{sexual}, @$s);
+ my $vios = min($viop, max map $_->{scr}{violence}, @$s);
my @sex = (0,0,0);
my @vio = (0,0,0);
@@ -625,8 +627,8 @@ sub screenshots_ {
my %rel;
push $rel{$_->{rid}}->@*, $_ for grep $_->{rid}, @$s;
- input_ name => 'scrhide_s', id => "scrhide_s$_", type => 'radio', class => 'visuallyhidden', $sexp == $_ ? (checked => 'checked') : () for 0..2;
- input_ name => 'scrhide_v', id => "scrhide_v$_", type => 'radio', class => 'visuallyhidden', $viop == $_ ? (checked => 'checked') : () for 0..2;
+ input_ name => 'scrhide_s', id => "scrhide_s$_", type => 'radio', class => 'visuallyhidden', $sexs == $_ ? (checked => 'checked') : () for 0..2;
+ input_ name => 'scrhide_v', id => "scrhide_v$_", type => 'radio', class => 'visuallyhidden', $vios == $_ ? (checked => 'checked') : () for 0..2;
div_ class => 'mainbox', id => 'screenshots', sub {
p_ class => 'mainopts', sub {