feat 电视剧无法识别集时发送消息
This commit is contained in:
@ -9,7 +9,6 @@ from app.core.config import settings
|
||||
from app.core.context import MediaInfo
|
||||
from app.core.meta import MetaBase
|
||||
from app.core.metainfo import MetaInfo
|
||||
from app.helper.format import FormatParser
|
||||
from app.log import logger
|
||||
from app.modules import _ModuleBase
|
||||
from app.schemas import TransferInfo
|
||||
@ -31,8 +30,7 @@ class FileTransferModule(_ModuleBase):
|
||||
pass
|
||||
|
||||
def transfer(self, path: Path, meta: MetaBase, mediainfo: MediaInfo,
|
||||
transfer_type: str, target: Path = None,
|
||||
formater: FormatParser = None) -> TransferInfo:
|
||||
transfer_type: str, target: Path = None) -> TransferInfo:
|
||||
"""
|
||||
文件转移
|
||||
:param path: 文件路径
|
||||
@ -40,7 +38,6 @@ class FileTransferModule(_ModuleBase):
|
||||
:param mediainfo: 识别的媒体信息
|
||||
:param transfer_type: 转移方式
|
||||
:param target: 目标路径
|
||||
:param formater: 集识别格式
|
||||
:return: {path, target_path, message}
|
||||
"""
|
||||
# 获取目标路径
|
||||
@ -54,8 +51,7 @@ class FileTransferModule(_ModuleBase):
|
||||
in_meta=meta,
|
||||
mediainfo=mediainfo,
|
||||
transfer_type=transfer_type,
|
||||
target_dir=target,
|
||||
formater=formater)
|
||||
target_dir=target)
|
||||
|
||||
@staticmethod
|
||||
def __transfer_command(file_item: Path, target_file: Path, transfer_type: str) -> int:
|
||||
@ -321,7 +317,6 @@ class FileTransferModule(_ModuleBase):
|
||||
mediainfo: MediaInfo,
|
||||
transfer_type: str,
|
||||
target_dir: Path,
|
||||
formater: FormatParser = None,
|
||||
) -> TransferInfo:
|
||||
"""
|
||||
识别并转移一个文件或者一个目录下的所有文件
|
||||
@ -330,7 +325,6 @@ class FileTransferModule(_ModuleBase):
|
||||
:param mediainfo: 媒体信息
|
||||
:param target_dir: 目的文件夹,非空的转移到该文件夹,为空时则按类型转移到配置文件中的媒体库文件夹
|
||||
:param transfer_type: 文件转移方式
|
||||
:param formater: 识别的剧集格式
|
||||
:return: TransferInfo、错误信息
|
||||
"""
|
||||
# 检查目录路径
|
||||
@ -396,24 +390,16 @@ class FileTransferModule(_ModuleBase):
|
||||
# 转移单个文件
|
||||
# 文件结束季为空
|
||||
in_meta.end_season = None
|
||||
|
||||
# 文件总季数为1
|
||||
if in_meta.total_season:
|
||||
in_meta.total_season = 1
|
||||
|
||||
# 文件不可能有多集
|
||||
if in_meta.total_episode > 2:
|
||||
in_meta.total_episode = 1
|
||||
in_meta.end_episode = None
|
||||
|
||||
# 自定义识别集数、PART
|
||||
if formater:
|
||||
# 开始集、结束集、PART
|
||||
begin_ep, end_ep, part = formater.split_episode(in_path.stem)
|
||||
if begin_ep is not None:
|
||||
in_meta.begin_episode = begin_ep
|
||||
in_meta.part = part
|
||||
if end_ep is not None:
|
||||
in_meta.end_episode = end_ep
|
||||
|
||||
# 目的文件名
|
||||
new_file = self.get_rename_path(
|
||||
path=target_dir,
|
||||
|
Reference in New Issue
Block a user