Fix bug in masto photo upload

This commit is contained in:
2023-02-15 07:26:52 +11:00
parent ee52e39267
commit 3f41aa87b1

View File

@@ -18,7 +18,7 @@ module Adamantium
content = if post[:name]
"#{post[:name]}#{settings.micropub_site_url}/post/#{post[:slug]}"
else
post[:content]
"#{post[:content]}#{settings.micropub_site_url}/post/#{post[:slug]}"
end
tags = post[:category].map { |tag| "##{tag}" }.join(" ")
@@ -47,6 +47,7 @@ module Adamantium
end
def upload_media(photo:)
mastodon_server = settings.mastodon_server.split("@").first
file = Tempfile.new(SecureRandom.uuid)
file.write(URI.open(photo[:value]).read)
file.rewind