Allow ugoira to be uploaded directly from the zip URL.
This refactors things such that * Fetching the ugoira frame data happens at the end of rewrite, not rewrite_html_pages. This way uploading zip URLs should work. * The source data is cached in an instance variable in case it was indeed fetched during rewrite_html_pages. This way it doesn't get fetched a second time.
This commit is contained in:
@@ -13,7 +13,7 @@ class UploadsController < ApplicationController
|
||||
"User-Agent" => "#{Danbooru.config.safe_app_name}/#{Danbooru.config.version}"
|
||||
}
|
||||
Downloads::RewriteStrategies::Base.strategies.each do |strategy|
|
||||
@normalized_url, headers = strategy.new.rewrite(@normalized_url, headers)
|
||||
@normalized_url, headers = strategy.new(@normalized_url).rewrite(@normalized_url, headers)
|
||||
end
|
||||
|
||||
@post = Post.find_by_source(@normalized_url)
|
||||
|
||||
Reference in New Issue
Block a user