tags: exclude deprecated tags from related tags list.

Don't show deprecated tags in the related tags or translated tags lists
when editing a post. It doesn't make sense to recommended adding tags
that can't be added to the post.
This commit is contained in:
evazion
2022-04-13 03:02:44 -05:00
parent e1c9a7d525
commit 15a0fd604b
4 changed files with 5 additions and 3 deletions

View File

@@ -59,7 +59,7 @@ module RelatedTagCalculator
tags = Tag.from(tag_counts).joins("JOIN tags ON tags.name = tag")
tags = tags.select("tags.*, overlap_count")
tags = tags.where("tags.post_count > 0")
tags = tags.nonempty.undeprecated
tags = tags.where(category: category) if category.present?
tags = tags.order("overlap_count DESC, tags.post_count DESC, tags.name")
tags

View File

@@ -227,7 +227,7 @@ module Source
def translated_tags
translated_tags = normalized_tags.flat_map(&method(:translate_tag)).uniq.sort
translated_tags.reject(&:artist?)
translated_tags.reject(&:artist?).reject(&:is_deprecated?)
end
# Given a tag from the source site, should return an array of corresponding Danbooru tags.