diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb index a4df65274..f5ce14ca2 100644 --- a/app/controllers/uploads_controller.rb +++ b/app/controllers/uploads_controller.rb @@ -5,7 +5,7 @@ class UploadsController < ApplicationController def new @upload_notice_wiki = WikiPage.titled(Danbooru.config.upload_notice_wiki_page).first - @upload, @post, @source, @remote_size = UploadService::ControllerHelper.prepare( + @upload, @remote_size = UploadService::ControllerHelper.prepare( url: params[:url], ref: params[:ref] ) respond_with(@upload) @@ -43,7 +43,7 @@ class UploadsController < ApplicationController end def preprocess - @upload, @post, @source, @remote_size = UploadService::ControllerHelper.prepare( + @upload, @remote_size = UploadService::ControllerHelper.prepare( url: upload_params[:source], file: upload_params[:file], ref: upload_params[:referer_url] ) render body: nil diff --git a/app/logical/upload_service/controller_helper.rb b/app/logical/upload_service/controller_helper.rb index d401be88b..ed69803c7 100644 --- a/app/logical/upload_service/controller_helper.rb +++ b/app/logical/upload_service/controller_helper.rb @@ -4,14 +4,8 @@ class UploadService upload = Upload.new if Utils.is_downloadable?(url) && file.nil? - strategy = Sources::Strategies.find(url, ref) - post = Post.where("SourcePattern(lower(posts.source)) IN (?)", [url, strategy.canonical_url]).first - - if post.nil? - # this gets called from UploadsController#new so we need - # to preprocess async - Preprocessor.new(source: url, referer_url: ref).delay(priority: -1, queue: "default").delayed_start(CurrentUser.id) - end + # this gets called from UploadsController#new so we need to preprocess async + Preprocessor.new(source: url, referer_url: ref).delay(priority: -1, queue: "default").delayed_start(CurrentUser.id) begin download = Downloads::File.new(url, ref) @@ -19,7 +13,7 @@ class UploadService rescue Exception end - return [upload, post, strategy, remote_size] + return [upload, remote_size] end if file @@ -36,4 +30,4 @@ class UploadService end end end -end \ No newline at end of file +end diff --git a/app/views/sources/_info.html.erb b/app/views/sources/_info.html.erb index 69780a02f..8dfb9ed0f 100644 --- a/app/views/sources/_info.html.erb +++ b/app/views/sources/_info.html.erb @@ -1,5 +1,3 @@ -<%# source %> -
<%= link_to "Fetch source data", source_path(:format => "json"), :id => "fetch-data-manual" %>
<%= content_tag "span", "Loading source data...", :id => "loading-data", :style => "display: none;" %>
diff --git a/app/views/uploads/_post.html.erb b/app/views/uploads/_post.html.erb deleted file mode 100644 index d2b5a4258..000000000 --- a/app/views/uploads/_post.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%# post %> -<% if post %> -