diff --git a/app/models/post.rb b/app/models/post.rb index 4a35f4cc6..1d2121e50 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -499,7 +499,7 @@ class Post < ApplicationRecord end def add_automatic_tags(tags) - tags -= %w(incredibly_absurdres absurdres highres lowres huge_filesize flash webm mp4) + tags -= %w(incredibly_absurdres absurdres highres lowres huge_filesize flash) if has_dimensions? if image_width >= 10_000 || image_height >= 10_000 @@ -532,12 +532,8 @@ class Post < ApplicationRecord tags << "flash" end - if is_webm? - tags << "webm" - end - - if is_mp4? - tags << "mp4" + if is_video? + tags << "video" end if is_ugoira? diff --git a/test/unit/post_test.rb b/test/unit/post_test.rb index 3f73b5934..b324a89d0 100644 --- a/test/unit/post_test.rb +++ b/test/unit/post_test.rb @@ -1295,18 +1295,18 @@ class PostTest < ActiveSupport::TestCase context "with a .webm file extension" do setup do - FactoryBot.create(:tag_implication, antecedent_name: "webm", consequent_name: "animated") + FactoryBot.create(:tag_implication, antecedent_name: "video", consequent_name: "animated") @post.file_ext = "webm" @post.tag_string = "" @post.save end should "have the appropriate file type tag added automatically" do - assert_match(/webm/, @post.tag_string) + assert_match(/video/, @post.tag_string) end should "apply implications after adding the file type tag" do - assert(@post.has_tag?("animated"), "expected 'webm' to imply 'animated'") + assert(@post.has_tag?("animated"), "expected 'video' to imply 'animated'") end end