summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/Misc.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VNDB/DB/Misc.pm')
-rw-r--r--lib/VNDB/DB/Misc.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/VNDB/DB/Misc.pm b/lib/VNDB/DB/Misc.pm
index f9eb459a..4b31ebb4 100644
--- a/lib/VNDB/DB/Misc.pm
+++ b/lib/VNDB/DB/Misc.pm
@@ -27,7 +27,7 @@ sub dbStats {
sub dbItemEdit {
my($self, $type, $oid, %o) = @_;
- my $fun = {qw|v vn r release p producer|}->{$type};
+ my $fun = {qw|v vn r release p producer c char|}->{$type};
$self->dbExec('SELECT edit_!s_init(?)', $fun, $oid);
$self->dbExec('UPDATE edit_revision !H', {
'requester = ?' => $o{uid}||$self->authInfo->{id},
@@ -40,6 +40,7 @@ sub dbItemEdit {
$self->dbVNRevisionInsert( \%o) if $type eq 'v';
$self->dbProducerRevisionInsert(\%o) if $type eq 'p';
$self->dbReleaseRevisionInsert( \%o) if $type eq 'r';
+ $self->dbCharRevisionInsert( \%o) if $type eq 'c';
return $self->dbRow('SELECT * FROM edit_!s_commit()', $fun);
}
@@ -59,10 +60,10 @@ sub dbRevisionGet {
$o{what} ||= '';
$o{releases} = 0 if !$o{type} || $o{type} ne 'v' || !$o{iid};
- my %tables = qw|v vn r releases p producers|;
+ my %tables = qw|v vn r releases p producers c chars|;
# what types should we join?
my @types = (
- !$o{type} ? ('v', 'r', 'p') :
+ !$o{type} ? ('v', 'r', 'p', 'c') :
$o{type} ne 'v' ? $o{type} :
$o{releases} ? ('v', 'r') : 'v'
);
@@ -102,7 +103,7 @@ sub dbRevisionGet {
$o{what} =~ /user/ ? 'u.username' : (),
$o{what} =~ /item/ ? (
'COALESCE('.join(', ', map "${_}r.${_}id", @types).') AS iid',
- 'COALESCE('.join(', ', map $_ eq 'p' ? 'pr.name' : "${_}r.title", @types).') AS ititle',
+ 'COALESCE('.join(', ', map /[pc]/ ? "${_}r.name" : "${_}r.title", @types).') AS ititle',
'COALESCE('.join(', ', map "${_}r.original", @types).') AS ioriginal',
) : (),
);