Skip to content

Commit

Permalink
fix #536
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Sep 10, 2023
1 parent 1bd7b5c commit afb5874
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions app/chain/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,18 @@ def do_transfer(self, path: Path, meta: MetaBase = None,
continue

# 整理屏蔽词不处理
is_blocked = False
if transfer_exclude_words:
for keyword in transfer_exclude_words:
if not keyword:
continue
if keyword and re.findall(keyword, file_path_str):
if keyword and re.search(r"%s" % keyword, file_path_str, re.IGNORECASE):
logger.info(f"{file_path} 命中整理屏蔽词 {keyword},不处理")
continue
is_blocked = True
break
if is_blocked:
err_msgs.append(f"{file_path.name} 命中整理屏蔽词")
continue

# 转移成功的不再处理
if not force:
Expand Down
2 changes: 1 addition & 1 deletion app/plugins/dirmonitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def event_handler(self, event, mon_path: str, text: str, event_path: str):
for keyword in transfer_exclude_words:
if not keyword:
continue
if keyword and re.findall(keyword, event_path):
if keyword and re.search(r"%s" % keyword, event_path, re.IGNORECASE):
logger.info(f"{event_path} 命中整理屏蔽词 {keyword},不处理")
return

Expand Down

0 comments on commit afb5874

Please sign in to comment.