posts: autoremove tagme on posts with >30 tags.
If you're able to add 30 tags then you don't need to tag it tagme.
This commit is contained in:
@@ -427,7 +427,6 @@ class Post < ApplicationRecord
|
|||||||
normalized_tags = filter_metatags(normalized_tags)
|
normalized_tags = filter_metatags(normalized_tags)
|
||||||
normalized_tags = TagAlias.to_aliased(normalized_tags)
|
normalized_tags = TagAlias.to_aliased(normalized_tags)
|
||||||
normalized_tags = remove_negated_tags(normalized_tags)
|
normalized_tags = remove_negated_tags(normalized_tags)
|
||||||
normalized_tags = %w[tagme] if normalized_tags.empty?
|
|
||||||
normalized_tags = add_automatic_tags(normalized_tags)
|
normalized_tags = add_automatic_tags(normalized_tags)
|
||||||
normalized_tags = remove_invalid_tags(normalized_tags)
|
normalized_tags = remove_invalid_tags(normalized_tags)
|
||||||
normalized_tags = Tag.convert_cosplay_tags(normalized_tags)
|
normalized_tags = Tag.convert_cosplay_tags(normalized_tags)
|
||||||
@@ -460,6 +459,12 @@ class Post < ApplicationRecord
|
|||||||
def add_automatic_tags(tags)
|
def add_automatic_tags(tags)
|
||||||
tags -= %w[incredibly_absurdres absurdres highres lowres flash video ugoira animated_gif animated_png exif_rotation non-repeating_animation]
|
tags -= %w[incredibly_absurdres absurdres highres lowres flash video ugoira animated_gif animated_png exif_rotation non-repeating_animation]
|
||||||
|
|
||||||
|
if tags.size >= 30
|
||||||
|
tags -= ["tagme"]
|
||||||
|
elsif tags.empty?
|
||||||
|
tags << "tagme"
|
||||||
|
end
|
||||||
|
|
||||||
if image_width >= 10_000 || image_height >= 10_000
|
if image_width >= 10_000 || image_height >= 10_000
|
||||||
tags << "incredibly_absurdres"
|
tags << "incredibly_absurdres"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user