mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Simpler regex
This commit is contained in:
parent
a022fcb8f1
commit
2421f559be
@ -47,11 +47,11 @@ class Consumer(Renderable):
|
|||||||
DEFAULT_OCR_LANGUAGE = settings.OCR_LANGUAGE
|
DEFAULT_OCR_LANGUAGE = settings.OCR_LANGUAGE
|
||||||
|
|
||||||
REGEX_TITLE = re.compile(
|
REGEX_TITLE = re.compile(
|
||||||
r"^.*/([^/]*)\.(pdf|jpe?g|png|gif|tiff)$",
|
r"^.*/(.*)\.(pdf|jpe?g|png|gif|tiff)$",
|
||||||
flags=re.IGNORECASE
|
flags=re.IGNORECASE
|
||||||
)
|
)
|
||||||
REGEX_SENDER_TITLE = re.compile(
|
REGEX_SENDER_TITLE = re.compile(
|
||||||
r"^.*/(.+) - ([^/]+)\.(pdf|jpe?g|png|gif|tiff)$",
|
r"^.*/(.+) - (.*)\.(pdf|jpe?g|png|gif|tiff)$",
|
||||||
flags=re.IGNORECASE
|
flags=re.IGNORECASE
|
||||||
)
|
)
|
||||||
REGEX_SENDER_TITLE_TAGS = re.compile(
|
REGEX_SENDER_TITLE_TAGS = re.compile(
|
||||||
@ -233,6 +233,7 @@ class Consumer(Renderable):
|
|||||||
def _store(self, text, doc):
|
def _store(self, text, doc):
|
||||||
|
|
||||||
sender, title, tags, file_type = self._guess_attributes_from_name(doc)
|
sender, title, tags, file_type = self._guess_attributes_from_name(doc)
|
||||||
|
tags = list(tags)
|
||||||
|
|
||||||
lower_text = text.lower()
|
lower_text = text.lower()
|
||||||
relevant_tags = set(
|
relevant_tags = set(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user