This was only halfways supported, as the download module does not have an image_url function. So for this, it just uses the url function, which is just the original URL passed into the download function. Additionally, it adds support to grab the largest available image, which it does by using the file_url function of the downloads module. - Fixes image_url parameter - Adds file_url parameter
14 lines
478 B
Ruby
14 lines
478 B
Ruby
class IqdbQueriesController < ApplicationController
|
|
respond_to :html, :json, :xml, :js
|
|
|
|
def show
|
|
# XXX allow bare search params for backwards compatibility.
|
|
search_params.merge!(params.slice(:url, :image_url, :file_url, :post_id, :limit, :similarity, :high_similarity).permit!)
|
|
|
|
@high_similarity_matches, @low_similarity_matches, @matches = IqdbProxy.search(search_params)
|
|
respond_with(@matches, template: "iqdb_queries/show")
|
|
end
|
|
|
|
alias create show
|
|
end
|