summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Releases
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-11-19 13:36:27 +0100
committerYorhel <git@yorhel.nl>2020-11-19 13:36:29 +0100
commit9c833152097d0840370b7cb89004a488f5477baa (patch)
tree852e9cf0d7421f3dff4f9318ab08f56b619efe58 /lib/VNWeb/Releases
parent83c60ce9587196b0bf3309c4ce4fdfff88f2dd89 (diff)
Releases: Add "official" flag
https://vndb.org/t15011
Diffstat (limited to 'lib/VNWeb/Releases')
-rw-r--r--lib/VNWeb/Releases/Edit.pm2
-rw-r--r--lib/VNWeb/Releases/Lib.pm5
-rw-r--r--lib/VNWeb/Releases/Page.pm2
3 files changed, 7 insertions, 2 deletions
diff --git a/lib/VNWeb/Releases/Edit.pm b/lib/VNWeb/Releases/Edit.pm
index 0163521b..ebdb9850 100644
--- a/lib/VNWeb/Releases/Edit.pm
+++ b/lib/VNWeb/Releases/Edit.pm
@@ -8,6 +8,7 @@ my $FORM = {
title => { maxlength => 300 },
original => { required => 0, default => '', maxlength => 250 },
rtype => { default => 'complete', enum => \%RELEASE_TYPE },
+ official => { anybool => 1 },
patch => { anybool => 1 },
freeware => { anybool => 1 },
doujin => { anybool => 1 },
@@ -114,6 +115,7 @@ TUWF::get qr{/$RE{vid}/add}, sub {
title => $v->{title},
original => $v->{original},
vn => [{vid => $v->{id}, title => $v->{title}}],
+ official => 1,
};
enrich_form $e;
diff --git a/lib/VNWeb/Releases/Lib.pm b/lib/VNWeb/Releases/Lib.pm
index 5be64efd..2694cfb9 100644
--- a/lib/VNWeb/Releases/Lib.pm
+++ b/lib/VNWeb/Releases/Lib.pm
@@ -26,7 +26,7 @@ sub releases_by_vn {
# Assumption: Each release already has id, type, patch, released, gtin and enrich_extlinks().
sub enrich_release {
my($r) = @_;
- enrich_merge id => 'SELECT id, title, original, notes, minage, freeware, doujin, reso_x, reso_y, voiced, ani_story, ani_ero, uncensored FROM releases WHERE id IN', $r;
+ enrich_merge id => 'SELECT id, title, original, notes, minage, official, freeware, doujin, reso_x, reso_y, voiced, ani_story, ani_ero, uncensored FROM releases WHERE id IN', $r;
enrich_merge id => sql('SELECT rid as id, status as rlist_status FROM rlists WHERE uid =', \auth->uid, 'AND rid IN'), $r if auth;
enrich_flatten lang => id => id => sub { sql 'SELECT id, lang FROM releases_lang WHERE id IN', $_, 'ORDER BY id, lang' }, $r;
enrich_flatten platforms => id => id => sub { sql 'SELECT id, platform FROM releases_platforms WHERE id IN', $_, 'ORDER BY id, platform' }, $r;
@@ -109,7 +109,8 @@ sub release_row_ {
};
td_ class => 'tc4', sub {
a_ href => "/r$r->{id}", title => $r->{original}||$r->{title}, $r->{title};
- b_ class => 'grayedout', ' (patch)' if $r->{patch};
+ my $note = join ' ', $r->{official} ? () : 'unofficial', $r->{patch} ? 'patch' : ();
+ b_ class => 'grayedout', " ($note)" if $note;
};
td_ class => 'tc_icons', sub { icons_ $r };
td_ class => 'tc_prod', join ' & ', $r->{publisher} ? 'Pub' : (), $r->{developer} ? 'Dev' : () if $prodpage;
diff --git a/lib/VNWeb/Releases/Page.pm b/lib/VNWeb/Releases/Page.pm
index e60d84b6..bc885c33 100644
--- a/lib/VNWeb/Releases/Page.pm
+++ b/lib/VNWeb/Releases/Page.pm
@@ -24,6 +24,7 @@ sub _rev_ {
revision_ r => $r, \&enrich_item,
[ vn => 'Relations', fmt => sub { a_ href => "/v$_->{vid}", title => $_->{original}||$_->{title}, $_->{title} } ],
[ type => 'Type' ],
+ [ official => 'Official', fmt => 'bool' ],
[ patch => 'Patch', fmt => 'bool' ],
[ freeware => 'Freeware', fmt => 'bool' ],
[ doujin => 'Doujin', fmt => 'bool' ],
@@ -82,6 +83,7 @@ sub _infotable_ {
abbr_ class => "icons rt$r->{type}", title => $r->{type}, ' ';
txt_ ' '.$RELEASE_TYPE{$r->{type}};
txt_ ', patch' if $r->{patch};
+ txt_ ', unofficial' if !$r->{official};
}
};