summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/Tags.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-02-28 16:51:16 +0100
committerYorhel <git@yorhel.nl>2009-02-28 16:51:16 +0100
commit4d9209d273b0c8e1929137b4866eec4deebc98c9 (patch)
tree106448e1df154450fa240a669fe887eff77ecaad /lib/VNDB/DB/Tags.pm
parent82a66074209f8cc2e23f9fb738aa869894cb83c9 (diff)
Voting on spoilerness of a tag works
(interface is somewhat on the half-hearted side, but oh well)
Diffstat (limited to 'lib/VNDB/DB/Tags.pm')
-rw-r--r--lib/VNDB/DB/Tags.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/VNDB/DB/Tags.pm b/lib/VNDB/DB/Tags.pm
index 2250ff90..9ed6560b 100644
--- a/lib/VNDB/DB/Tags.pm
+++ b/lib/VNDB/DB/Tags.pm
@@ -101,11 +101,13 @@ sub dbTagLinks {
# Change a user's tags for a VN entry
-# Arguments: uid, vid, [ [ tag, vote ], .. ]
+# Arguments: uid, vid, [ [ tag, vote, spoiler ], .. ]
sub dbTagLinkEdit {
my($self, $uid, $vid, $tags) = @_;
$self->dbExec('DELETE FROM tags_vn WHERE vid = ? AND uid = ?', $vid, $uid);
- $self->dbExec('INSERT INTO tags_vn (tag, vid, uid, vote) VALUES (?, ?, ?, ?)', $_->[0], $vid, $uid, $_->[1]) for (@$tags);
+ $self->dbExec('INSERT INTO tags_vn (tag, vid, uid, vote, spoiler) VALUES (?, ?, ?, ?, ?)',
+ $_->[0], $vid, $uid, $_->[1], $_->[2] == -1 ? undef : $_->[2]
+ ) for (@$tags);
}