mass tag replace: update -> update ignore + delete ignored
git-svn-id: file:///home/shish/svn/shimmie2/trunk@593 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
1e76d9de9d
commit
2d88fb75c2
@ -76,7 +76,8 @@ class TagEdit extends Extension {
|
|||||||
$replace_id = $database->db->GetOne("SELECT id FROM tags WHERE tag=?", array($replace));
|
$replace_id = $database->db->GetOne("SELECT id FROM tags WHERE tag=?", array($replace));
|
||||||
if($search_id && $replace_id) {
|
if($search_id && $replace_id) {
|
||||||
// FIXME: what if the (image_id,tag_id) pair already exists?
|
// FIXME: what if the (image_id,tag_id) pair already exists?
|
||||||
$database->Execute("UPDATE image_tags SET tag_id=? WHERE tag_id=?", Array($replace_id, $search_id));
|
$database->Execute("UPDATE IGNORE image_tags SET tag_id=? WHERE tag_id=?", Array($replace_id, $search_id));
|
||||||
|
$database->Execute("DELETE FROM image_tags WHERE tag_id=?", Array($search_id));
|
||||||
}
|
}
|
||||||
else if($search_id) {
|
else if($search_id) {
|
||||||
$database->Execute("UPDATE tags SET tag=? WHERE tag=?", Array($replace, $search));
|
$database->Execute("UPDATE tags SET tag=? WHERE tag=?", Array($replace, $search));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user