remove references to ssd previews
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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." : ""
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user