support json for iqdb query actions
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
class IqdbQueriesController < ApplicationController
|
||||
respond_to :html, :json, :xml
|
||||
respond_to :html, :json
|
||||
|
||||
def show
|
||||
if params[:url]
|
||||
url = URI.parse(Danbooru.config.iqdbs_server)
|
||||
url.path = "/similar"
|
||||
url.query = {callback: iqdb_queries_url, url: params[:url]}.to_query
|
||||
url.query = {callback: iqdb_queries_url(format: params[:format]), url: params[:url]}.to_query
|
||||
redirect_to url.to_s
|
||||
return
|
||||
end
|
||||
@@ -14,7 +14,7 @@ class IqdbQueriesController < ApplicationController
|
||||
post = Post.find(params[:post_id])
|
||||
url = URI.parse(Danbooru.config.iqdbs_server)
|
||||
url.path = "/similar"
|
||||
url.query = {callback: iqdb_queries_url, url: post.preview_file_url}.to_query
|
||||
url.query = {callback: iqdb_queries_url(format: params[:format]), url: post.preview_file_url}.to_query
|
||||
redirect_to url.to_s
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user