diff options
author | Yorhel <git@yorhel.nl> | 2009-12-05 18:29:53 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-12-05 18:32:47 +0100 |
commit | 9aa6f31f9a800157dd6899e3b237316890e2872f (patch) | |
tree | d34f43d4bf96dd62182ce470f14c1fd12c333e2f /lib | |
parent | f8becca564556989db2973577336ea3fb8f5fd7e (diff) |
SQL: Call update_vncache() in a trigger
This removes the need for the dbVNCache() function in perl.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/DB/VN.pm | 9 | ||||
-rw-r--r-- | lib/VNDB/Handler/Misc.pm | 7 | ||||
-rw-r--r-- | lib/VNDB/Handler/Releases.pm | 2 |
3 files changed, 2 insertions, 16 deletions
diff --git a/lib/VNDB/DB/VN.pm b/lib/VNDB/DB/VN.pm index a5df65f2..bc99f17c 100644 --- a/lib/VNDB/DB/VN.pm +++ b/lib/VNDB/DB/VN.pm @@ -7,7 +7,7 @@ use Exporter 'import'; use VNDB::Func 'gtintype'; use Encode 'decode_utf8'; -our @EXPORT = qw|dbVNGet dbVNRevisionInsert dbVNImageId dbVNCache dbScreenshotAdd dbScreenshotGet dbScreenshotRandom|; +our @EXPORT = qw|dbVNGet dbVNRevisionInsert dbVNImageId dbScreenshotAdd dbScreenshotGet dbScreenshotRandom|; # Options: id, rev, char, search, lang, platform, tags_include, tags_exclude, results, page, what, sort, reverse @@ -211,13 +211,6 @@ sub dbVNImageId { } -# Updates the vn.c_ columns -sub dbVNCache { - my($self, @vn) = @_; - $self->dbExec('SELECT update_vncache(?)', $_) for (@vn); -} - - # insert a new screenshot and return it's ID # (no arguments required, as Multi is responsible for filling the entry with information) sub dbScreenshotAdd { diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm index 3bcce26b..625b0463 100644 --- a/lib/VNDB/Handler/Misc.pm +++ b/lib/VNDB/Handler/Misc.pm @@ -342,16 +342,11 @@ sub itemmod { return $self->htmlDenied if !$self->authCan($act eq 'hide' ? 'del' : 'lock'); my $obj = $type eq 'v' ? $self->dbVNGet(id => $iid)->[0] : - $type eq 'r' ? $self->dbReleaseGet(id => $iid, what => 'vn extended')->[0] : + $type eq 'r' ? $self->dbReleaseGet(id => $iid, what => 'extended')->[0] : $self->dbProducerGet(id => $iid, what => 'extended')->[0]; return 404 if !$obj->{id}; $self->dbItemMod($type, $iid, $act eq 'hide' ? (hidden => !$obj->{hidden}) : (locked => !$obj->{locked})); - - # update cached vn info when hiding an r+ page - $self->dbVNCache(map $_->{vid}, @{$obj->{vn}}) - if $type eq 'r' && $act eq 'hide'; - $self->resRedirect("/$type$iid", 'temp'); } diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm index 1097f43b..724ecf4e 100644 --- a/lib/VNDB/Handler/Releases.pm +++ b/lib/VNDB/Handler/Releases.pm @@ -361,8 +361,6 @@ sub edit { ($rev) = $self->dbItemEdit(r => $rid, %opts) if !$copy && $rid; ($rid) = $self->dbItemAdd(r => %opts) if $copy || !$rid; - $self->dbVNCache(@$new_vn, map $_->{vid}, @$vn); - return $self->resRedirect("/r$rid.$rev", 'post'); } } |