Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Giraffaman committed Mar 23, 2024
1 parent cc60cbe commit 71fa19d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions ext/auto_tagger/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,15 @@ public function onTagSet(TagSetEvent $event): void
}
error_log("auto-tagger: checking results for metatags...");
# need to check tags again for metatags
foreach ($results as $r) {
if (str_contains($r, ':') || str_contains($r, '=')) {
$ttpe = send_event(new TagTermCheckEvent($r));
foreach ($tags as $tag) {
if ((!str_contains($tag, ':')) && (!str_contains($tag, '='))) {
$event->new_tags[] = $r;
error_log("auto-tagger: ".$r." is definitely a normal tag.");
continue;
}

$ttpe = send_event(new TagTermCheckEvent($tag));

//seperate tags from metatags
if (!$ttpe->metatag) {
$event->new_tags[] = $r;
Expand Down
2 changes: 1 addition & 1 deletion ext/post_tags/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function onTagSet(TagSetEvent $event): void
error_log("post_tag: new tag set!");
if ($user->can(Permissions::EDIT_IMAGE_TAG) && (!$event->image->is_locked() || $user->can(Permissions::EDIT_IMAGE_LOCK))) {
foreach($event->new_tags as $nt) {
error_log("new tag ".$nt." is normal tag");
error_log("post_tag ".$nt." is normal tag");
}
$event->image->set_tags($event->new_tags);
}
Expand Down

0 comments on commit 71fa19d

Please sign in to comment.