mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
media size total
This commit is contained in:
parent
b22a152d9d
commit
960acfca72
1 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue