diff --git a/app/lib/admin/metrics/measure/instance_media_attachments_measure.rb b/app/lib/admin/metrics/measure/instance_media_attachments_measure.rb index 8fa5234b429..1e1089f2173 100644 --- a/app/lib/admin/metrics/measure/instance_media_attachments_measure.rb +++ b/app/lib/admin/metrics/measure/instance_media_attachments_measure.rb @@ -38,11 +38,7 @@ class Admin::Metrics::Measure::InstanceMediaAttachmentsMeasure < Admin::Metrics: def data_source MediaAttachment - .select( - <<~SQL.squish - COALESCE(media_attachments.file_file_size, 0) + COALESCE(media_attachments.thumbnail_file_size, 0) AS size - SQL - ) + .select(media_size_total) .joins(:account) .where(account_domain_sql, domain: params[:domain]) .where(daily_period(:media_attachments)) @@ -54,6 +50,12 @@ class Admin::Metrics::Measure::InstanceMediaAttachmentsMeasure < Admin::Metrics: SQL end + def media_size_total + <<~SQL.squish + COALESCE(media_attachments.file_file_size, 0) + COALESCE(media_attachments.thumbnail_file_size, 0) AS size + SQL + end + def params @params.permit(:domain, :include_subdomains) end