From 6dd517a490eb76419baedbc5f381febe48207419 Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 13 Sep 2023 12:45:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=20=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E8=AF=8D=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/meta/words.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/core/meta/words.py b/app/core/meta/words.py index 213938ec..3bc7ece4 100644 --- a/app/core/meta/words.py +++ b/app/core/meta/words.py @@ -30,15 +30,15 @@ class WordsMatcher(metaclass=Singleton): try: if word.count(" => ") and word.count(" && ") and word.count(" >> ") and word.count(" <> "): # 替换词 - thc = re.findall(r'(.*?)\s*=>', word)[0] + thc = str(re.findall(r'(.*?)\s*=>', word)[0]).strip() # 被替换词 - bthc = re.findall(r'=>\s*(.*?)\s*&&', word)[0] + bthc = str(re.findall(r'=>\s*(.*?)\s*&&', word)[0]).strip() # 集偏移前字段 - pyq = re.findall(r'&&\s*(.*?)\s*<>', word)[0] + pyq = str(re.findall(r'&&\s*(.*?)\s*<>', word)[0]).strip() # 集偏移后字段 - pyh = re.findall(r'<>(.*?)\s*>>', word)[0] + pyh = str(re.findall(r'<>(.*?)\s*>>', word)[0]).strip() # 集偏移 - offsets = re.findall(r'>>\s*(.*?)$', word)[0] + offsets = str(re.findall(r'>>\s*(.*?)$', word)[0]).strip() # 替换词 title, message, state = self.__replace_regex(title, thc, bthc) if state: From 68c7bf0a96c9e415a5e82733805a985e35d2b2ff Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 13 Sep 2023 13:10:11 +0800 Subject: [PATCH 2/2] Revert "fix" This reverts commit 7c3c6ee999f5faffceed9e7177febd86cd4f7aad. --- app/plugins/mediasyncdel/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/plugins/mediasyncdel/__init__.py b/app/plugins/mediasyncdel/__init__.py index 5caab2ee..28889923 100644 --- a/app/plugins/mediasyncdel/__init__.py +++ b/app/plugins/mediasyncdel/__init__.py @@ -572,6 +572,11 @@ class MediaSyncDel(_PluginBase): stop_cnt = 0 error_cnt = 0 for transferhis in transfer_history: + title = transferhis.title + if title not in media_name: + logger.warn( + f"当前转移记录 {transferhis.id} {title} {transferhis.tmdbid} 与删除媒体{media_name}不符,防误删,暂不自动删除") + continue image = transferhis.image year = transferhis.year @@ -807,6 +812,11 @@ class MediaSyncDel(_PluginBase): stop_cnt = 0 error_cnt = 0 for transferhis in transfer_history: + title = transferhis.title + if title not in media_name: + logger.warn( + f"当前转移记录 {transferhis.id} {title} {transferhis.tmdbid} 与删除媒体{media_name}不符,防误删,暂不自动删除") + continue image = transferhis.image # 0、删除转移记录 self._transferhis.delete(transferhis.id)