lib/sapos/print/q_reader.rb in sapos-print-1.1.1 vs lib/sapos/print/q_reader.rb in sapos-print-1.1.2

- old
+ new

@@ -19,24 +19,26 @@ msgid = envelope.result.dig(:data, :publish_time_object, :timetoken) print_control = nil document_number = nil puts msg.inspect if reader.config.verbose - + + printer_name = nil if msg.is_a?(Hash) print_control = msg['print_control'] document_number = msg['document_number'] + printer_name = msg["printer"] msg = msg['document'] end document = Base64.decode64(msg) current_printer = reader.printer - printer_name = 'default' - if msg['printer'] && reader.printers[msg['printer']] - printer_name = msg['printer'] - current_printer = reader.printers[msg['printer']] + + if printer_name && reader.printers[printer_name] + current_printer = reader.printers[printer_name] end + puts "Printer Config: #{current_printer.to_h}" if reader.config.verbose if !current_printer.print(document: document, print_control: print_control, document_number: document_number, id: msgid, printer: printer_name) puts "Printer Error" end rescue => e \ No newline at end of file