@@ -256,7 +256,7 @@ def _determine_analysis_backlog(self, storage_type, storage_manager, root=None,
256
256
file_name = storage_manager .split_path (path )
257
257
258
258
# we'll use the default printer profile for the backlog since we don't know better
259
- queue_entry = QueueEntry (file_name , entry , file_type , storage_type , path , self ._printer_profile_manager .get_default ())
259
+ queue_entry = QueueEntry (file_name , entry , file_type , storage_type , path , self ._printer_profile_manager .get_default (), None )
260
260
if self ._analysis_queue .enqueue (queue_entry , high_priority = high_priority ):
261
261
counter += 1
262
262
@@ -476,12 +476,9 @@ def add_file(self, destination, path, file_object, links=None, allow_overwrite=F
476
476
477
477
path_in_storage = self ._storage (destination ).add_file (path , file_object , links = links , printer_profile = printer_profile , allow_overwrite = allow_overwrite , display = display )
478
478
479
- if analysis is None :
480
- queue_entry = self ._analysis_queue_entry (destination , path_in_storage , printer_profile = printer_profile )
481
- if queue_entry :
482
- self ._analysis_queue .enqueue (queue_entry , high_priority = True )
483
- else :
484
- self ._add_analysis_result (destination , path , analysis )
479
+ queue_entry = self ._analysis_queue_entry (destination , path_in_storage , printer_profile = printer_profile , analysis = analysis )
480
+ if queue_entry :
481
+ self ._analysis_queue .enqueue (queue_entry , high_priority = True )
485
482
486
483
_ , name = self ._storage (destination ).split_path (path_in_storage )
487
484
eventManager ().fire (Events .FILE_ADDED , dict (storage = destination ,
@@ -700,7 +697,7 @@ def _add_analysis_result(self, destination, path, result):
700
697
def _on_analysis_finished (self , entry , result ):
701
698
self ._add_analysis_result (entry .location , entry .path , result )
702
699
703
- def _analysis_queue_entry (self , destination , path , printer_profile = None ):
700
+ def _analysis_queue_entry (self , destination , path , printer_profile = None , analysis = None ):
704
701
if printer_profile is None :
705
702
printer_profile = self ._printer_profile_manager .get_current_or_default ()
706
703
@@ -709,6 +706,6 @@ def _analysis_queue_entry(self, destination, path, printer_profile=None):
709
706
file_type = get_file_type (absolute_path )
710
707
711
708
if file_type :
712
- return QueueEntry (file_name , path , file_type [- 1 ], destination , absolute_path , printer_profile )
709
+ return QueueEntry (file_name , path , file_type [- 1 ], destination , absolute_path , printer_profile , analysis )
713
710
else :
714
711
return None
0 commit comments