about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2020-05-14 14:45:52 +0900
committerGitHub <noreply@github.com>2020-05-14 07:45:52 +0200
commitcbfb2c0e71fd281e3e8f362d9016944884abc39e (patch)
treee778737ce75ad5c76c928126f3a06746a44ef201 /lib
parentaf53cfd19e5d8f5ae62b4e5f559f8c4fc2f0038f (diff)
Fix tootctl media refresh (#13751)
Diffstat (limited to 'lib')
-rw-r--r--lib/mastodon/media_cli.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mastodon/media_cli.rb b/lib/mastodon/media_cli.rb
index 506544446..2b1653335 100644
--- a/lib/mastodon/media_cli.rb
+++ b/lib/mastodon/media_cli.rb
@@ -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