book.arrived = File.ctime(filename)
book.classification_id = @store.find_classification(book.author.grouping, File.basename(filename, ".*"))
- return book unless category == NON_FIC_FOLDER && classification_id.nil?
+ return book unless category == NON_FIC_FOLDER && book.classification_id.nil?
- File.open(Store.unclassified_csv, "a") do |fd|
- fd.puts "#{grouping.inspect},#{path.inspect}"
+ File.open(@store.unclassified_csv, "a") do |fd|
+ fd.puts "#{grouping.inspect},#{filename.inspect}"
end
book
@threads = []
num_threads.times do
@threads << Thread.new do
- BookLoader.new(@config_file, @queue).run
+ store = Store.new(@config_file)
+ BookLoader.new(@config_file, @queue, store).run
end
end