uploads: fix batch upload page to work without bookmarklet.

* Add a form to the /uploads/batch page so that it can be used without
  the bookmarklet.

* Fix an exception when no url is given.
This commit is contained in:
evazion
2018-04-20 15:42:42 -05:00
parent 83b96b4f3f
commit 8083c7daae
4 changed files with 52 additions and 21 deletions

View File

@@ -20,9 +20,15 @@ class UploadsController < ApplicationController
end
def batch
@source = Sources::Site.new(params[:url], :referer_url => params[:ref])
@source.get
@urls = @source.image_urls
@url = params.dig(:batch, :url) || params[:url]
@source = nil
if @url
@source = Sources::Site.new(@url, :referer_url => params[:ref])
@source.get
end
respond_with(@source)
end
def image_proxy