Files
danbooru/app/controllers/iqdb_queries_controller.rb
evazion a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00

17 lines
573 B
Ruby

# frozen_string_literal: true
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, :hash, :image_url, :file_url, :post_id, :limit, :similarity, :high_similarity).permit!)
iqdb_params = search_params.to_h.symbolize_keys
@high_similarity_matches, @low_similarity_matches, @matches = IqdbClient.new.search(**iqdb_params)
respond_with(@matches, template: "iqdb_queries/show")
end
alias create show
end