From adcd693b71805e703d04d1306c0ac2575cd8f383 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 30 Jan 2024 10:29:42 -0500 Subject: [PATCH] Use existing `MediaAttachment.remote` scope in media CLI (#28912) --- lib/mastodon/cli/media.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mastodon/cli/media.rb b/lib/mastodon/cli/media.rb index 87946e0262..ac8f219807 100644 --- a/lib/mastodon/cli/media.rb +++ b/lib/mastodon/cli/media.rb @@ -58,7 +58,7 @@ module Mastodon::CLI end unless options[:prune_profiles] || options[:remove_headers] - processed, aggregate = parallelize_with_progress(MediaAttachment.cached.where.not(remote_url: '').where(created_at: ..time_ago)) do |media_attachment| + processed, aggregate = parallelize_with_progress(MediaAttachment.cached.remote.where(created_at: ..time_ago)) do |media_attachment| next if media_attachment.file.blank? size = (media_attachment.file_file_size || 0) + (media_attachment.thumbnail_file_size || 0)