reluce / szurubooru-toolkit

Python package and script collection to manage your szurubooru image board.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Option to keep existing tags when using auto-tagger

Kalidibus opened this issue · comments

When I use auto-tagger to tag a post with Saucenao results, it appears to remove any existing tags and replaces them fully with the new ones.

There are instances where I have custom tags, and it would be good to keep those, but still be able to use auto-tagger. Could this be an option in the config file?

commented

Hm, it should always keep the previous set tags. I also tried to reproduce it just now, but the script preserved the previous tag just fine.

Is it happening on all of your posts or just one? Is it a video/image? How many tag did you manually set?

Following lines are responsibly to keep the tags:

# Keep previous tags and add user tags if configured
if add_tags:
tags = list(set().union(post.tags, tags_by_md5, tags_by_sauce, tags_by_deepbooru, add_tags))
else:
tags = list(set().union(post.tags, tags_by_md5, tags_by_sauce, tags_by_deepbooru))
post.tags = [tag for tag in tags if tag is not None]

Very sorry - this was user error on my part. I had a couple examples but realized different reasons on my end why I was seeing the old tags disappear (in some cases, I just straight up didn't notice them because I was looking for a different name).