bug fixes for iqdb

This commit is contained in:
r888888888
2014-03-26 17:20:34 -07:00
parent 594b09b8c9
commit c41d2a733b
3 changed files with 9 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ module Iqdb
end
def process(&block)
IO.popen("iqdb #{database}", "w", &block)
IO.popen("iqdb command #{database}", "w", &block)
end
def add(post)

View File

@@ -13,7 +13,7 @@ module Iqdb
end
def open
@socket = TCPSocket.new(hostname, port)
@socket = TCPSocket.open(hostname, port)
end
def close
@@ -31,13 +31,17 @@ module Iqdb
request do
hex = post.id.to_s(16)
socket.puts "add 0 #{hex}:#{post.preview_file_path}"
socket.puts "done"
socket.read
end
end
def remove(post_id)
request do
hext = post_id.to_s(16)
hex = post_id.to_s(16)
socket.puts "remove 0 #{hex}"
socket.puts "done"
socket.read
end
end