Various silly fixes

This commit is contained in:
Kira 2019-07-22 16:57:26 -07:00
parent acf443b626
commit b4b40d9e37
3 changed files with 7 additions and 7 deletions

View File

@ -6,13 +6,14 @@ module TagChangeNoticeService
end
def get_forum_topic_id(tag)
redis_client.get("tcn:#{tag}")
false #redis_client.get("tcn:#{tag}")
end
def update_cache(affected_tags, forum_topic_id)
rc = redis_client
affected_tags.each do |tag|
rc.setex("tcn:#{tag}", 1.week, forum_topic_id)
end
# TODO: Revisit this idea and making it work with some kind of cache invalidation.
# rc = redis_client
# affected_tags.each do |tag|
# rc.setex("tcn:#{tag}", 1.week, forum_topic_id)
# end
end
end

View File

@ -214,7 +214,6 @@ class UploadService
return "" unless Danbooru.config.enable_dimension_autotagging
tags = []
tags << "video_with_sound" if is_video_with_audio?(upload, file)
tags << "animated_gif" if is_animated_gif?(upload, file)
tags << "animated_png" if is_animated_png?(upload, file)
tags.join(" ")

View File

@ -9,7 +9,7 @@ class UploadWhitelist < ApplicationRecord
ModAction.log(:upload_whitelist_create, {pattern: rec.pattern, note: rec.note, hidden: rec.hidden})
end
after_save do |rec|
ModAction.log(:upload_whitelist_update, {pattern: rec.pattern, note: rec.note, old_pattern: rec.pattern_before_save, hidden: rec.hidden})
ModAction.log(:upload_whitelist_update, {pattern: rec.pattern, note: rec.note, old_pattern: rec.pattern_before_last_save, hidden: rec.hidden})
end
after_destroy do |rec|
ModAction.log(:upload_whitelist_delete, {pattern: rec.pattern, note: rec.note, hidden: rec.hidden})