mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 16:25:33 +01:00
test cases
This commit is contained in:
parent
bef80037da
commit
73682d22d6
2 changed files with 60 additions and 2 deletions
|
|
@ -13,8 +13,14 @@ from ...parsers import get_parser_class_for_mime_type
|
|||
|
||||
def _process_document(doc_in):
|
||||
document = Document.objects.get(id=doc_in)
|
||||
parser = get_parser_class_for_mime_type(document.mime_type)(
|
||||
logging_group=None)
|
||||
parser_class = get_parser_class_for_mime_type(document.mime_type)
|
||||
|
||||
if parser_class:
|
||||
parser = parser_class(logging_group=None)
|
||||
else:
|
||||
print(f"{document} No parser for mime type {document.mime_type}")
|
||||
return
|
||||
|
||||
try:
|
||||
thumb = parser.get_optimised_thumbnail(
|
||||
document.source_path, document.mime_type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue