mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-10 23:11:47 +08:00
fix transfer
This commit is contained in:
@@ -72,7 +72,29 @@ class TransferChain(ChainBase):
|
|||||||
|
|
||||||
logger.info(f"获取到 {len(torrents)} 个已完成的下载任务")
|
logger.info(f"获取到 {len(torrents)} 个已完成的下载任务")
|
||||||
|
|
||||||
|
# 检查是否为下载器监控目录中的文件
|
||||||
|
need_handle = False
|
||||||
|
download_dirs = self.directoryhelper.get_download_dirs()
|
||||||
for torrent in torrents:
|
for torrent in torrents:
|
||||||
|
# 文件路径
|
||||||
|
file_path = Path(torrent.path)
|
||||||
|
if not file_path.exists():
|
||||||
|
logger.warn(f"文件不存在:{file_path}")
|
||||||
|
continue
|
||||||
|
# 检查是否为下载器监控目录中的文件
|
||||||
|
for dir_info in download_dirs:
|
||||||
|
if dir_info.monitor_type != "downloader":
|
||||||
|
continue
|
||||||
|
if not dir_info.download_path:
|
||||||
|
continue
|
||||||
|
if file_path.is_relative_to(Path(dir_info.download_path)):
|
||||||
|
need_handle = True
|
||||||
|
break
|
||||||
|
if not need_handle:
|
||||||
|
logger.info(f"文件 {file_path} 不在下载器监控目录中,不通过下载器进行整理")
|
||||||
|
# 设置下载任务状态
|
||||||
|
self.transfer_completed(hashs=torrent.hash, path=torrent.path)
|
||||||
|
continue
|
||||||
# 查询下载记录识别情况
|
# 查询下载记录识别情况
|
||||||
downloadhis: DownloadHistory = self.downloadhis.get_by_hash(torrent.hash)
|
downloadhis: DownloadHistory = self.downloadhis.get_by_hash(torrent.hash)
|
||||||
if downloadhis:
|
if downloadhis:
|
||||||
@@ -93,7 +115,6 @@ class TransferChain(ChainBase):
|
|||||||
mediainfo = None
|
mediainfo = None
|
||||||
|
|
||||||
# 执行转移
|
# 执行转移
|
||||||
file_path = Path(torrent.path)
|
|
||||||
self.__do_transfer(
|
self.__do_transfer(
|
||||||
fileitem=FileItem(
|
fileitem=FileItem(
|
||||||
storage="local",
|
storage="local",
|
||||||
|
|||||||
Reference in New Issue
Block a user