mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-04-13 17:52:28 +08:00
Merge pull request #3235 from wikrin/fix
This commit is contained in:
@@ -256,7 +256,7 @@ class DownloadChain(ChainBase):
|
||||
download_dir = Path(save_path)
|
||||
else:
|
||||
# 根据媒体信息查询下载目录配置
|
||||
dir_info = self.directoryhelper.get_dir(_media, storage="local")
|
||||
dir_info = self.directoryhelper.get_dir(_media, storage="local", include_unsorted=True)
|
||||
# 拼装子目录
|
||||
if dir_info:
|
||||
# 一级目录
|
||||
|
||||
@@ -407,7 +407,7 @@ class TransferChain(ChainBase):
|
||||
else:
|
||||
# 未指定目标路径,根据媒体信息获取目标目录
|
||||
target_directory = self.directoryhelper.get_dir(file_mediainfo,
|
||||
storage=target_storage,
|
||||
storage=file_item.storage,
|
||||
target_storage=target_storage)
|
||||
|
||||
# 执行整理
|
||||
|
||||
@@ -49,13 +49,14 @@ class DirectoryHelper:
|
||||
"""
|
||||
return [d for d in self.get_library_dirs() if d.library_storage == "local"]
|
||||
|
||||
def get_dir(self, media: MediaInfo,
|
||||
def get_dir(self, media: MediaInfo, include_unsorted: bool = False,
|
||||
storage: str = None, src_path: Path = None,
|
||||
target_storage: str = None, dest_path: Path = None
|
||||
) -> Optional[schemas.TransferDirectoryConf]:
|
||||
"""
|
||||
根据媒体信息获取下载目录、媒体库目录配置
|
||||
:param media: 媒体信息
|
||||
:param include_unsorted: 包含不整理目录
|
||||
:param storage: 源存储类型
|
||||
:param target_storage: 目标存储类型
|
||||
:param fileitem: 文件项,使用文件路径匹配
|
||||
@@ -73,7 +74,7 @@ class DirectoryHelper:
|
||||
# 按照配置顺序查找
|
||||
for d in dirs:
|
||||
# 没有启用整理的目录
|
||||
if not d.monitor_type:
|
||||
if not d.monitor_type and not include_unsorted:
|
||||
continue
|
||||
# 源存储类型不匹配
|
||||
if storage and d.storage != storage:
|
||||
|
||||
Reference in New Issue
Block a user