From 268d0450bc56c85726a022a4f6c624866d8c3c5d Mon Sep 17 00:00:00 2001 From: r888888888 Date: Mon, 5 Jun 2017 13:38:10 -0700 Subject: [PATCH] additional fixed for amazonbackup helper methods --- app/models/amazon_backup.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/amazon_backup.rb b/app/models/amazon_backup.rb index b41a0b521..59dd035ac 100644 --- a/app/models/amazon_backup.rb +++ b/app/models/amazon_backup.rb @@ -57,7 +57,7 @@ class AmazonBackup < ActiveRecord::Base Post.where("id >= ? and id <= ?", min_id, max_id).find_each do |post| if post.has_large? puts "large:#{post.id}" - key = "sample/sample-" + File.basename(post.large_file_path) + key = "sample/" + File.basename(post.large_file_path) f.call(key) end @@ -108,7 +108,7 @@ class AmazonBackup < ActiveRecord::Base if post.has_large? puts "large:#{post.id}" - key = "sample/sample-" + File.basename(post.large_file_path) + key = "sample/" + File.basename(post.large_file_path) f.call(key) end @@ -146,7 +146,7 @@ class AmazonBackup < ActiveRecord::Base end if File.exists?(post.large_file_path) - key = "sample/#{post.md5}.#{post.large_file_ext}" + key = "sample/#{Danbooru.config.large_image_prefix}#{post.md5}.#{post.large_file_ext}" body = open(post.large_file_path, "rb") client.put_object(bucket: bucket, key: key, body: body, acl: "public-read") end