diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake index a95a7258fa831582b6d04d4a7b3b14c0db3ab8bd..13220f68e3e23855e914a18072db654c629f227a 100644 --- a/lib/tasks/mastodon.rake +++ b/lib/tasks/mastodon.rake @@ -6,6 +6,11 @@ namespace :mastodon do task clear: :environment do MediaAttachment.where(status_id: nil).where('created_at < ?', 1.day.ago).find_each(&:destroy) end + + desc 'Remove media attachments attributed to silenced accounts' + task remove_silenced: :environment do + MediaAttachment.where(account: Account.silenced).find_each(&:destroy) + end end namespace :push do