Files
danbooru/app/logical/iqdb/importer.rb
r888888888 9e2c664a41 fixes #2130
2014-05-05 17:59:54 -07:00

17 lines
395 B
Ruby

module Iqdb
class Importer
def import!
Post.find_each do |post|
IO.popen("iqdb command #{Danbooru.config.iqdb_file}", "w+") do |io|
if File.exists?(post.preview_file_path)
hex = post.id.to_s(16)
io.puts "add 0 #{hex}:#{post.preview_file_path}"
end
io.puts "quit"
io.read
end
end
end
end
end