mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 00:05:21 +01:00
fix: allow for caps in file name suffixes #206
@schinkelg ran aground of this one and I took the opportunity to add a test to catch this sort of thing for next time.
This commit is contained in:
parent
5b88ebf0e7
commit
fa4924d5ba
5 changed files with 102 additions and 3 deletions
|
|
@ -102,7 +102,7 @@ class Consumer(object):
|
|||
parser_class = self._get_parser_class(doc)
|
||||
if not parser_class:
|
||||
self.log(
|
||||
"info", "No parsers could be found for {}".format(doc))
|
||||
"error", "No parsers could be found for {}".format(doc))
|
||||
self._ignore.append(doc)
|
||||
continue
|
||||
|
||||
|
|
@ -160,6 +160,16 @@ class Consumer(object):
|
|||
if result:
|
||||
options.append(result)
|
||||
|
||||
self.log(
|
||||
"info",
|
||||
"Parsers available: {}".format(
|
||||
", ".join([str(o["parser"].__name__) for o in options])
|
||||
)
|
||||
)
|
||||
|
||||
if not options:
|
||||
return None
|
||||
|
||||
# Return the parser with the highest weight.
|
||||
return sorted(
|
||||
options, key=lambda _: _["weight"], reverse=True)[0]["parser"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue