A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
debug log mime type #176
jonaswinklercffe9fa354c5
diff --git a/src/documents/consumer.py b/src/documents/consumer.pyindex 37630bc21..ab07b3149 100755--- a/src/documents/consumer.py+++ b/src/documents/consumer.py@@ -95,19 +95,20 @@ class Consumer(LoggingMixin):self.pre_check_directories()self.pre_check_duplicate()- self.log("info", "Consuming {}".format(self.filename))+ self.log("info", f"Consuming {self.filename}")# Determine the parser class.mime_type = magic.from_file(self.path, mime=True)+ self.log("debug", f"Detected mime type: {mime_type}")+parser_class = get_parser_class_for_mime_type(mime_type)if not parser_class:raise ConsumerError(f"No parsers available for {self.filename}")else:self.log("debug",- f"Parser: {parser_class.__name__} "- f"based on mime type {mime_type}")+ f"Parser: {parser_class.__name__}")# Notify all listeners that we're going to do some work.