iqdb fixes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module Iqdb
|
||||
class Download
|
||||
attr_reader :source, :download, :similar_posts
|
||||
attr_reader :source, :download, :matches
|
||||
|
||||
def initialize(source)
|
||||
@source = source
|
||||
@@ -14,7 +14,7 @@ module Iqdb
|
||||
|
||||
def find_similar
|
||||
if Danbooru.config.iqdb_hostname_and_port
|
||||
@similar_posts = Iqdb::Server.new(*Danbooru.config.iqdb_hostname_and_port).query(0, 3, @download.file_path)
|
||||
@matches = Iqdb::Server.new(*Danbooru.config.iqdb_hostname_and_port).query(0, 3, @download.file_path).matches
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<% if @download.similar_posts %>
|
||||
<% if @download.matches %>
|
||||
<h3>Similar</h3>
|
||||
<% @download.similar_posts.each do |similar| %>
|
||||
<%= PostPresenter.preview(Post.find(similar.post_id)) %>
|
||||
<% @download.matches.each do |match| %>
|
||||
<%= PostPresenter.preview(Post.find(match.post_id)) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user