Merge pull request #575 from thsrite/main

This commit is contained in:
jxxghp 2023-09-13 13:26:09 +08:00 committed by GitHub
commit 8ee391688d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View File

@ -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:

View File

@ -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)