fix #285
This commit is contained in:
@ -145,6 +145,7 @@ class DirMonitor(_PluginBase):
|
|||||||
self.systemmessage.put(f"{target_path} 是下载目录 {mon_path} 的子目录,无法监控")
|
self.systemmessage.put(f"{target_path} 是下载目录 {mon_path} 的子目录,无法监控")
|
||||||
continue
|
continue
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
logger.debug(str(e))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -237,9 +238,12 @@ class DirMonitor(_PluginBase):
|
|||||||
file_meta.merge(meta)
|
file_meta.merge(meta)
|
||||||
|
|
||||||
if not file_meta.name:
|
if not file_meta.name:
|
||||||
logger.warn(f"{file_path.name} 无法识别有效信息")
|
logger.error(f"{file_path.name} 无法识别有效信息")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# 查询转移目的目录
|
||||||
|
target: Path = self._dirconf.get(mon_path)
|
||||||
|
|
||||||
# 识别媒体信息
|
# 识别媒体信息
|
||||||
mediainfo: MediaInfo = self.chain.recognize_media(meta=file_meta)
|
mediainfo: MediaInfo = self.chain.recognize_media(meta=file_meta)
|
||||||
if not mediainfo:
|
if not mediainfo:
|
||||||
@ -249,15 +253,25 @@ class DirMonitor(_PluginBase):
|
|||||||
mtype=NotificationType.Manual,
|
mtype=NotificationType.Manual,
|
||||||
title=f"{file_path.name} 未识别到媒体信息,无法入库!"
|
title=f"{file_path.name} 未识别到媒体信息,无法入库!"
|
||||||
))
|
))
|
||||||
|
# 新增转移成功历史记录
|
||||||
|
self.transferhis.add_force(
|
||||||
|
src=event_path,
|
||||||
|
dest=str(target),
|
||||||
|
mode=self._transfer_type,
|
||||||
|
title=meta.name,
|
||||||
|
year=meta.year,
|
||||||
|
seasons=file_meta.season,
|
||||||
|
episodes=file_meta.episode,
|
||||||
|
status=0,
|
||||||
|
errmsg="未识别到媒体信息",
|
||||||
|
date=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
||||||
|
)
|
||||||
return
|
return
|
||||||
logger.info(f"{file_path.name} 识别为:{mediainfo.type.value} {mediainfo.title_year}")
|
logger.info(f"{file_path.name} 识别为:{mediainfo.type.value} {mediainfo.title_year}")
|
||||||
|
|
||||||
# 更新媒体图片
|
# 更新媒体图片
|
||||||
self.chain.obtain_images(mediainfo=mediainfo)
|
self.chain.obtain_images(mediainfo=mediainfo)
|
||||||
|
|
||||||
# 查询转移目的目录
|
|
||||||
target = self._dirconf.get(mon_path)
|
|
||||||
|
|
||||||
# 转移
|
# 转移
|
||||||
transferinfo: TransferInfo = self.chain.transfer(mediainfo=mediainfo,
|
transferinfo: TransferInfo = self.chain.transfer(mediainfo=mediainfo,
|
||||||
path=file_path,
|
path=file_path,
|
||||||
@ -285,11 +299,12 @@ class DirMonitor(_PluginBase):
|
|||||||
|
|
||||||
target_path = str(transferinfo.file_list_new[0]) if transferinfo.file_list_new else str(
|
target_path = str(transferinfo.file_list_new[0]) if transferinfo.file_list_new else str(
|
||||||
transferinfo.target_path)
|
transferinfo.target_path)
|
||||||
|
|
||||||
# 新增转移成功历史记录
|
# 新增转移成功历史记录
|
||||||
self.transferhis.add_force(
|
self.transferhis.add_force(
|
||||||
src=event_path,
|
src=event_path,
|
||||||
dest=target_path,
|
dest=target_path,
|
||||||
mode=settings.TRANSFER_TYPE,
|
mode=self._transfer_type,
|
||||||
type=mediainfo.type.value,
|
type=mediainfo.type.value,
|
||||||
category=mediainfo.category,
|
category=mediainfo.category,
|
||||||
title=mediainfo.title,
|
title=mediainfo.title,
|
||||||
|
Reference in New Issue
Block a user