From 4b1264991f239680d3b497dce01c7f3af6c7f32f Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 20 Mar 2022 16:49:36 -0500 Subject: [PATCH] users: remove 'spoilers' tag from default blacklist. Rationale: * The spoilers tag is the most frequently removed tag from the default blacklist. * It's frustrating for regular users to have posts randomly hidden because of trivial spoilers from a series they don't care about. * The spoilers tag is used way too liberally for things that aren't considered spoilers on other sites. * If you're looking up fanart on the internet, you should expect to see a certain level of spoilers. * The tag is used very inconsistently, with some characters like Nia_(blade)_(xenoblade) getting the spoilers tag half the time and the rest of the time not. --- app/models/user.rb | 2 +- script/fixes/107_update_default_blacklist.rb | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 script/fixes/107_update_default_blacklist.rb diff --git a/app/models/user.rb b/app/models/user.rb index 323fe94d2..4d9a76717 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -67,7 +67,7 @@ class User < ApplicationRecord is_verified ] - DEFAULT_BLACKLIST = ["spoilers", "guro", "scat", "furry -rating:s"].join("\n") + DEFAULT_BLACKLIST = ["guro", "scat", "furry -rating:s"].join("\n") attribute :id attribute :created_at diff --git a/script/fixes/107_update_default_blacklist.rb b/script/fixes/107_update_default_blacklist.rb new file mode 100755 index 000000000..41c253c3c --- /dev/null +++ b/script/fixes/107_update_default_blacklist.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +require_relative "base" + +with_confirmation do + User.where(blacklisted_tags: "spoilers\nguro\nscat\nfurry -rating:s").update_all(blacklisted_tags: User::DEFAULT_BLACKLIST) + User.where(blacklisted_tags: "spoilers\r\nguro\r\nscat\r\nfurry -rating:s").update_all(blacklisted_tags: User::DEFAULT_BLACKLIST) + User.where(blacklisted_tags: "spoilers\r\nguro\r\nscat\r\nfurry -rating:s\r\n").update_all(blacklisted_tags: User::DEFAULT_BLACKLIST) + + User.where(blacklisted_tags: "spoilers\nguro\nscat").update_all(blacklisted_tags: "guro\nscat") + User.where(blacklisted_tags: "spoilers\r\nguro\r\nscat").update_all(blacklisted_tags: "guro\nscat") + User.where(blacklisted_tags: "spoilers\r\nguro\r\nscat\r\n").update_all(blacklisted_tags: "guro\nscat") + + User.where(blacklisted_tags: "spoilers\nscat\nfurry -rating:s").update_all(blacklisted_tags: "scat\nfurry -rating:s") + User.where(blacklisted_tags: "spoilers\r\nscat\r\nfurry -rating:s").update_all(blacklisted_tags: "scat\nfurry -rating:s") + + User.where(blacklisted_tags: "spoilers\nguro\nscat\nfurry -rating:s\nyaoi").update_all(blacklisted_tags: "guro\nscat\nfurry -rating:s\nyaoi") +end