mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix an error when file_file_size is nil in tootctl media remove (#14657)
This commit is contained in:
parent
92319d7340
commit
175cd4f8ef
@ -31,7 +31,7 @@ module Mastodon
|
|||||||
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.where.not(remote_url: '').where('created_at < ?', time_ago)) do |media_attachment|
|
||||||
next if media_attachment.file.blank?
|
next if media_attachment.file.blank?
|
||||||
|
|
||||||
size = media_attachment.file_file_size + (media_attachment.thumbnail_file_size || 0)
|
size = (media_attachment.file_file_size || 0) + (media_attachment.thumbnail_file_size || 0)
|
||||||
|
|
||||||
unless options[:dry_run]
|
unless options[:dry_run]
|
||||||
media_attachment.file.destroy
|
media_attachment.file.destroy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user