posts: stop autotagging huge_filesize.
https://danbooru.donmai.us/forum_topics/19526
This commit is contained in:
@@ -460,7 +460,7 @@ class Post < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def add_automatic_tags(tags)
|
def add_automatic_tags(tags)
|
||||||
tags -= %w[incredibly_absurdres absurdres highres lowres huge_filesize 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 image_width >= 10_000 || image_height >= 10_000
|
if image_width >= 10_000 || image_height >= 10_000
|
||||||
tags << "incredibly_absurdres"
|
tags << "incredibly_absurdres"
|
||||||
@@ -481,10 +481,6 @@ class Post < ApplicationRecord
|
|||||||
tags << "tall_image"
|
tags << "tall_image"
|
||||||
end
|
end
|
||||||
|
|
||||||
if file_size >= 10.megabytes
|
|
||||||
tags << "huge_filesize"
|
|
||||||
end
|
|
||||||
|
|
||||||
if is_flash?
|
if is_flash?
|
||||||
tags << "flash"
|
tags << "flash"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1382,18 +1382,6 @@ class PostTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with a large file size" do
|
|
||||||
setup do
|
|
||||||
@post.file_size = 11.megabytes
|
|
||||||
@post.tag_string = ""
|
|
||||||
@post.save
|
|
||||||
end
|
|
||||||
|
|
||||||
should "have the appropriate file size tags added automatically" do
|
|
||||||
assert_match(/huge_filesize/, @post.tag_string)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context "with a .zip file extension" do
|
context "with a .zip file extension" do
|
||||||
setup do
|
setup do
|
||||||
@post.file_ext = "zip"
|
@post.file_ext = "zip"
|
||||||
|
|||||||
Reference in New Issue
Block a user