]> cat aescling's git repositories - mastodon.git/commitdiff
Fix tootctl media refresh (#13751)
authorTakeshi Umeda <noel.yoshiba@gmail.com>
Thu, 14 May 2020 05:45:52 +0000 (14:45 +0900)
committerGitHub <noreply@github.com>
Thu, 14 May 2020 05:45:52 +0000 (07:45 +0200)
lib/mastodon/media_cli.rb

index 50654444650b11d2300f041b42518bdafab7337c..2b16533359827a28b4e9f586a2449fc78887f5db 100644 (file)
@@ -198,7 +198,7 @@ module Mastodon
       if options[:status]
         scope = MediaAttachment.where(status_id: options[:status])
       elsif options[:account]
-        username, domain = username.split('@')
+        username, domain = options[:account].split('@')
         account = Account.find_remote(username, domain)
 
         if account.nil?
@@ -217,7 +217,7 @@ module Mastodon
         next if media_attachment.remote_url.blank? || (!options[:force] && media_attachment.file_file_name.present?)
 
         unless options[:dry_run]
-          media_attachment.reset_file!
+          media_attachment.file_remote_url = media_attachment.remote_url
           media_attachment.save
         end