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