From a5f268563d06ab85ef1e237fb963be238dc63e5d Mon Sep 17 00:00:00 2001 From: r888888888 Date: Mon, 10 Mar 2014 13:00:01 -0700 Subject: [PATCH] remove references to ssd previews --- app/models/post.rb | 23 ++--------------------- app/models/upload.rb | 9 --------- config/danbooru_default_config.rb | 5 ----- config/deploy.rb | 3 --- 4 files changed, 2 insertions(+), 38 deletions(-) diff --git a/app/models/post.rb b/app/models/post.rb index 3a9dfe6bd..34f1f856d 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -43,21 +43,18 @@ class Post < ActiveRecord::Base def distribute_files RemoteFileManager.new(file_path).distribute RemoteFileManager.new(real_preview_file_path).distribute if is_image? - RemoteFileManager.new(ssd_preview_file_path).distribute if Danbooru.config.ssd_path && is_image? RemoteFileManager.new(large_file_path).distribute if has_large? end def delete_remote_files RemoteFileManager.new(file_path).delete RemoteFileManager.new(real_preview_file_path).delete if is_image? - RemoteFileManager.new(ssd_preview_file_path).delete if Danbooru.config.ssd_path && is_image? RemoteFileManager.new(large_file_path).delete if has_large? end def delete_files FileUtils.rm_f(file_path) FileUtils.rm_f(large_file_path) - FileUtils.rm_f(ssd_preview_file_path) if Danbooru.config.ssd_path FileUtils.rm_f(real_preview_file_path) end @@ -77,20 +74,8 @@ class Post < ActiveRecord::Base end end - def real_preview_file_path - "#{Rails.root}/public/data/preview/#{file_path_prefix}#{md5}.jpg" - end - - def ssd_preview_file_path - "#{Danbooru.config.ssd_path}/public/data/preview/#{file_path_prefix}#{md5}.jpg" - end - def preview_file_path - if Danbooru.config.ssd_path - ssd_preview_file_path - else - real_preview_file_path - end + "#{Rails.root}/public/data/preview/#{file_path_prefix}#{md5}.jpg" end def file_url @@ -110,11 +95,7 @@ class Post < ActiveRecord::Base return "/images/download-preview.png" end - if Danbooru.config.ssd_path - "/ssd/data/preview/#{file_path_prefix}#{md5}.jpg" - else - "/data/preview/#{file_path_prefix}#{md5}.jpg" - end + "/data/preview/#{file_path_prefix}#{md5}.jpg" end def file_url_for(user) diff --git a/app/models/upload.rb b/app/models/upload.rb index 2ac39c06d..689335a34 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -155,10 +155,6 @@ 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.config.ssd_path - Danbooru.resize(source_path, ssd_file_path, width, height, quality) - end end end @@ -228,11 +224,6 @@ class Upload < ActiveRecord::Base "#{Rails.root}/public/data/#{prefix}#{md5}.#{file_ext}" end - def ssd_file_path - prefix = Rails.env == "test" ? "test." : "" - "#{Danbooru.config.ssd_path}/public/data/preview/#{prefix}#{md5}.jpg" - end - def resized_file_path_for(width) prefix = Rails.env == "test" ? "test." : "" diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index 20d8756f6..72af661fa 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -82,11 +82,6 @@ module Danbooru 300 end - # If a solid state drive is availble, cache the thumbnails on the SSD to reduce disk seek times. - def ssd_path - nil - end - # Where the ad banners are stored in the file system def advertisement_path nil diff --git a/config/deploy.rb b/config/deploy.rb index cb37b7251..807c6c833 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -68,9 +68,6 @@ namespace :data do run "rm -f #{release_path}/public/data" run "ln -s #{deploy_to}/shared/data #{release_path}/public/data" - run "rm -f #{release_path}/public/ssd" - run "ln -s /mnt/ssd#{deploy_to}/current/public #{release_path}/public/ssd" - run "rm -f #{release_path}/public/images/advertisements" run "ln -s #{deploy_to}/shared/advertisements #{release_path}/public/images/advertisements"