diff options
author | Yorhel <git@yorhel.nl> | 2019-08-19 15:10:35 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-08-19 15:10:35 +0200 |
commit | afc254e53b8f81a8d05e47b99a7a9245477e8303 (patch) | |
tree | 3fb86c8cda5fa431777d3981e478790166ed14e5 /lib/VNDB | |
parent | fdfc92a0520bb30dbc26ada97223ee075e702b3e (diff) |
Add Melonbooks.com links to releases + minor edit form reorg
Diffstat (limited to 'lib/VNDB')
-rw-r--r-- | lib/VNDB/DB/Releases.pm | 13 | ||||
-rw-r--r-- | lib/VNDB/Handler/Releases.pm | 26 | ||||
-rw-r--r-- | lib/VNDB/Util/Misc.pm | 1 |
3 files changed, 26 insertions, 14 deletions
diff --git a/lib/VNDB/DB/Releases.pm b/lib/VNDB/DB/Releases.pm index c2996d25..b2cdde8b 100644 --- a/lib/VNDB/DB/Releases.pm +++ b/lib/VNDB/DB/Releases.pm @@ -85,8 +85,11 @@ sub dbReleaseGet { ); my @select = ( - qw|r.id r.title r.original r.website r.l_steam r.l_dlsite r.l_dlsiteen r.l_gog r.l_denpa r.l_jlist r.l_gyutto r.l_digiket r.released r.minage r.type r.patch|, - $o{what} =~ /extended/ ? qw|r.notes r.catalog r.gtin r.resolution r.voiced r.freeware r.doujin r.uncensored r.ani_story r.ani_ero r.engine r.hidden r.locked| : (), + qw|r.id r.title r.original r.website r.released r.minage r.type r.patch|, + $o{what} =~ /extended/ ? qw| + r.notes r.catalog r.gtin r.resolution r.voiced r.freeware r.doujin r.uncensored r.ani_story r.ani_ero r.engine r.hidden r.locked + r.l_steam r.l_dlsite r.l_dlsiteen r.l_gog r.l_denpa r.l_jlist r.l_gyutto r.l_digiket r.l_melon + | : (), $o{pid} ? ('rp.developer', 'rp.publisher') : (), ); @@ -123,8 +126,9 @@ sub dbReleaseGetRev { $o{rev} ||= $self->dbRow('SELECT MAX(rev) AS rev FROM changes WHERE type = \'r\' AND itemid = ?', $o{id})->{rev}; - my $select = 'c.itemid AS id, r.title, r.original, r.website, r.l_steam, r.l_dlsite, r.l_dlsiteen, r.l_gog, r.l_denpa, r.l_jlist, r.l_gyutto, r.l_digiket, r.released, r.minage, r.type, r.patch'; + my $select = 'c.itemid AS id, r.title, r.original, r.website, r.released, r.minage, r.type, r.patch'; $select .= ', r.notes, r.catalog, r.gtin, r.resolution, r.voiced, r.freeware, r.doujin, r.uncensored, r.ani_story, r.ani_ero, r.engine, ro.hidden, ro.locked' if $o{what} =~ /extended/; + $select .= ', r.l_steam, r.l_dlsite, r.l_dlsiteen, r.l_gog, r.l_denpa, r.l_jlist, r.l_gyutto, r.l_digiket, r.l_melon' if $o{what} =~ /extended/; $select .= ', extract(\'epoch\' from c.added) as added, c.requester, c.comments, u.username, c.rev, c.ihid, c.ilock'; $select .= ', c.id AS cid, NOT EXISTS(SELECT 1 FROM changes c2 WHERE c2.type = c.type AND c2.itemid = c.itemid AND c2.rev = c.rev+1) AS lastrev'; @@ -214,7 +218,8 @@ sub dbReleaseRevisionInsert { my($self, $o) = @_; my %set = map exists($o->{$_}) ? ("$_ = ?", $o->{$_}) : (), - qw|title original gtin catalog website l_steam l_dlsite l_dlsiteen l_gog l_denpa l_jlist l_gyutto l_digiket released notes minage type + qw|title original gtin catalog website released notes minage type + l_steam l_dlsite l_dlsiteen l_gog l_denpa l_jlist l_gyutto l_digiket l_melon patch resolution voiced freeware doujin uncensored ani_story ani_ero engine|; $self->dbExec('UPDATE edit_releases !H', \%set) if keys %set; diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm index 6c9967fc..0e2b4e5e 100644 --- a/lib/VNDB/Handler/Releases.pm +++ b/lib/VNDB/Handler/Releases.pm @@ -316,7 +316,7 @@ sub edit { my $vn = $rid ? $r->{vn} : [{ vid => $vid, title => $v->{title} }]; my %b4 = !$rid ? () : ( (map { $_ => $r->{$_} } qw|type title original gtin catalog languages website released minage - l_steam l_dlsite l_dlsiteen l_gog l_denpa l_jlist l_gyutto l_digiket + l_steam l_dlsite l_dlsiteen l_gog l_denpa l_jlist l_gyutto l_digiket l_melon notes platforms patch resolution voiced freeware doujin uncensored ani_story ani_ero engine ihid ilock|), media => join(',', sort map "$_->{medium} $_->{qty}", @{$r->{media}}), producers => join('|||', map @@ -350,6 +350,7 @@ sub edit { { post => 'l_jlist', required => 0, default => '', regex => [ qr/^[a-z0-9-]+$/, 'Invalid J-List ID' ] }, { post => 'l_gyutto', required => 0, default => 0, template => 'uint' }, { post => 'l_digiket', required => 0, default => 0, func => [ sub { $_[0] =~ s/^(?:ITM)?0+//; $_[0] =~ /^[0-9]+$/ }, 'Invalid Digiket ID' ] }, + { post => 'l_melon', required => 0, default => 0, func => [ sub { $_[0] =~ s/^(?:IT)?0+//; $_[0] =~ /^[0-9]+$/ }, 'Invalid Melonbooks.com ID' ] }, { post => 'released', required => 0, default => 0, template => 'rdate' }, { post => 'minage' , required => 0, default => -1, enum => $self->{age_ratings} }, { post => 'notes', required => 0, default => '', maxlength => 10240 }, @@ -403,7 +404,7 @@ sub edit { if(!$frm->{_err}) { my $nrev = $self->dbItemEdit(r => !$copy && $rid ? ($r->{id}, $r->{rev}) : (undef, undef), (map { $_ => $frm->{$_} } qw| type title original gtin catalog languages website released minage - l_steam l_dlsite l_dlsiteen l_gog l_denpa l_jlist l_gyutto l_digiket + l_steam l_dlsite l_dlsiteen l_gog l_denpa l_jlist l_gyutto l_digiket l_melon notes platforms resolution editsum patch voiced freeware doujin uncensored ani_story ani_ero engine ihid ilock|), vn => $new_vn, producers => $producers, @@ -450,19 +451,24 @@ sub _form { [ input => short => 'gtin', name => 'JAN/UPC/EAN' ], [ input => short => 'catalog', name => 'Catalog number' ], [ input => short => 'website', name => 'Official website' ], - [ input => short => 'l_steam', name => 'Steam AppID', pre => 'https://store.steampowered.com/app/', width => 100 ], - [ input => short => 'l_dlsite', name => 'DLsite (jpn)', post => ' e.g. "RJ083922"', width => 100 ], - [ input => short => 'l_dlsiteen',name => 'DLsite (eng)', post => ' e.g. "RE083922"', width => 100 ], - [ input => short => 'l_gog', name => 'GOG.com', pre => 'https://www.gog.com/game/' ], - [ input => short => 'l_denpa', name => 'Denpasoft', pre => 'https://denpasoft.com/products/' ], - [ input => short => 'l_jlist', name => 'J-List', pre => 'https://www.jlist.com/', post => ' (the last part of the URL, e.g. "np004")' ], - [ input => short => 'l_gyutto', name => 'Gyutto', pre => 'https://gyutto.com/i/item', post => ' (item number)' ], - [ input => short => 'l_digiket', name => 'Digiket', pre => 'https://www.digiket.com/work/show/_data/ID=ITM', post => ' (item number)' ], [ date => short => 'released', name => 'Release date' ], [ static => content => 'Leave month or day blank if they are unknown' ], [ select => short => 'minage', name => 'Age rating', options => [ map [ $_, minage $_, 1 ], @{$self->{age_ratings}} ] ], [ check => short => 'uncensored',name => 'No mosaic or other optical censoring (only check if this release has erotic content)' ], + + [ static => nolabel => 1, content => '<br><b>Webshop links</b>' ], + [ input => short => 'l_steam', name => 'Steam AppID', pre => 'store.steampowered.com/app/', width => 100 ], + [ input => short => 'l_jlist', name => 'J-List', pre => 'www.jlist.com/', post => ' (the last part of the URL, e.g. "np004")', width => 100 ], + [ input => short => 'l_denpa', name => 'Denpasoft', pre => 'denpasoft.com/products/' ], + [ input => short => 'l_gog', name => 'GOG.com', pre => 'www.gog.com/game/' ], + [ input => short => 'l_dlsiteen',name => 'DLsite (eng)', pre => 'www.dlsite.com/../product_id/', post => ' e.g. "RE083922"', width => 100 ], + [ input => short => 'l_dlsite', name => 'DLsite (jpn)', pre => 'www.dlsite.com/../product_id/', post => ' e.g. "RJ083922"', width => 100 ], + [ input => short => 'l_digiket', name => 'Digiket', pre => 'www.digiket.com/work/show/_data/ID=ITM', width => 100 ], + [ input => short => 'l_gyutto', name => 'Gyutto', pre => 'gyutto.com/i/item', post => ' (item number)', width => 100 ], + [ input => short => 'l_melon', name => 'Melonbooks.com', pre => 'www.melonbooks.com/..&products_id=IT', width => 100 ], + + [ static => nolabel => 1, content => '<br>' ], [ textarea => short => 'notes', name => 'Notes<br /><b class="standout">English please!</b>' ], [ static => content => 'Miscellaneous notes/comments, information that does not fit in the above fields.' diff --git a/lib/VNDB/Util/Misc.pm b/lib/VNDB/Util/Misc.pm index 866e2c78..0a980ebf 100644 --- a/lib/VNDB/Util/Misc.pm +++ b/lib/VNDB/Util/Misc.pm @@ -204,6 +204,7 @@ sub entryLinks { $lnk->($obj->{l_jlist}, 'J-List', 'https://www.jlist.com/%s'); $lnk->($obj->{l_gyutto}, 'Gyutto', 'https://gyutto.com/i/item%d'); $lnk->($obj->{l_digiket}, 'Digiket', 'https://www.digiket.com/work/show/_data/ID=ITM%07d/'); + $lnk->($obj->{l_melon}, 'Melonbooks', 'https://www.melonbooks.com/index.php?main_page=product_info&products_id=IT%010d'); } # Staff links |