about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-08-03 05:50:15 -0500
committermultiple creatures <dev@multiple-creature.party>2019-08-03 05:50:15 -0500
commitceaf900dfc80400ec35514fce20ecb7c26406158 (patch)
tree5c86864ec3c7243ac46ee6f2290fa16b760da93a
parenta96d89ac567cbb9e0631682f3b78a26bcf5a9ba9 (diff)
properly interpret `severity: nomedia` from `vulpine.club` yaml
-rw-r--r--app/helpers/blocklist_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/blocklist_helper.rb b/app/helpers/blocklist_helper.rb
index f916579ec..fe12792fd 100644
--- a/app/helpers/blocklist_helper.rb
+++ b/app/helpers/blocklist_helper.rb
@@ -43,7 +43,8 @@ module BlocklistHelper
       next if domain.blank?
       severity = entry['severity'].split('/')
       reject_media = 'nomedia'.in?(severity)
-      severity = severity[0] || 'noop'
+      severity = (severity[0].nil? || severity[0] == 'nomedia') ? 'noop' : severity[0]
+
       reason = "(imported from vulpine.club) #{entry['reason']}#{entry['link'].present? ? " (#{entry['link']})" : ''}".rstrip
       {domain: domain, severity: severity.to_sym, reject_media: reject_media, reason: reason}
     end