Skip to content

Commit

Permalink
use Tag/SourceSetEvent for mass editing, to ensure the standard rules…
Browse files Browse the repository at this point in the history
… are followed
  • Loading branch information
shish committed Jul 3, 2023
1 parent 340b9da commit c1c5084
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ext/tag_edit/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ private function mass_tag_edit(string $search, string $replace, bool $commit)
foreach ($images as $image) {
$before = array_map('strtolower', $image->get_tag_array());
$after = array_merge(array_diff($before, $search_set), $replace_set);
$image->set_tags($after);

send_event(new TagSetEvent($image, $after));
$last_id = $image->id;
}
if ($commit) {
Expand Down Expand Up @@ -371,7 +370,7 @@ private function mass_source_edit(string $tags, string $source)
}

foreach ($images as $image) {
$image->set_source($source);
send_event(new SourceSetEvent($image, $source));
$last_id = $image->id;
}
}
Expand Down

0 comments on commit c1c5084

Please sign in to comment.