diff --git a/app/models/upload.rb b/app/models/upload.rb index ed468f380..2491049cf 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -50,7 +50,6 @@ class Upload < ActiveRecord::Base module ConversionMethods def process! force=false return if !force && status =~ /processing|completed|error/ - return if Socket.gethostname != server CurrentUser.scoped(uploader, uploader_ip_addr) do update_attribute(:status, "processing") @@ -145,6 +144,9 @@ class Upload < ActiveRecord::Base end Danbooru.resize(source_path, resized_file_path_for(width), width, height, quality) + if width == Danbooru.config.small_image_width + Danbooru.resize(source_path, ssd_file_path, width, height, quality) + end end end @@ -213,6 +215,11 @@ class Upload < ActiveRecord::Base "#{Rails.root}/public/data/#{prefix}#{md5}.#{file_ext}" end + def ssd_file_path + prefix = Rails.env == "test" ? "test." : "" + "#{Rails.root}/public/ssd/data/#{prefix}#{md5}.#{file_ext}" + end + def resized_file_path_for(width) prefix = Rails.env == "test" ? "test." : ""