uploads: use storage manager to distribute files.
Refactors the upload process to pass around temp files, rather than passing around file paths and directly writing output to the local filesystem. This way we can pass the storage manager the preview / sample / original temp files, so it can deal with storage itself. * Change Download::File#download! to return a temp file. * Change DanbooruImageResizer and PixivUgoiraConverter to accept/return temp files instead of file paths. * Change Upload#generate_resizes to return temp files for previews and samples. * Change Upload#generate_resizes to generate ugoira .webm samples synchronously instead of asynchronously.
This commit is contained in:
@@ -6,7 +6,7 @@ class UploadsController < ApplicationController
|
||||
@upload = Upload.new
|
||||
@upload_notice_wiki = WikiPage.titled(Danbooru.config.upload_notice_wiki_page).first
|
||||
if params[:url]
|
||||
download = Downloads::File.new(params[:url], ".")
|
||||
download = Downloads::File.new(params[:url])
|
||||
@normalized_url, _, _ = download.before_download(params[:url], {})
|
||||
@post = find_post_by_url(@normalized_url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user