fix transfer bug

This commit is contained in:
jxxghp
2024-09-14 13:19:51 +08:00
parent 57bad6353c
commit 8bb25afcdc
3 changed files with 7 additions and 4 deletions

View File

@@ -1,6 +1,9 @@
name: MoviePilot Builder
on:
workflow_dispatch:
push:
branches:
- dev
jobs:
Docker-build:

View File

@@ -86,7 +86,7 @@ class TransferChain(ChainBase):
for torrent in torrents:
# 文件路径
file_path = Path(torrent.path)
file_path = torrent.path
if not file_path.exists():
logger.warn(f"文件不存在:{file_path}")
continue
@@ -103,7 +103,7 @@ class TransferChain(ChainBase):
if not transfer_dirinfo:
logger.info(f"文件 {file_path} 不在下载器监控目录中,不通过下载器进行整理")
# 设置下载任务状态
self.transfer_completed(hashs=torrent.hash, path=torrent.path)
self.transfer_completed(hashs=torrent.hash, path=file_path)
continue
# 查询下载记录识别情况
downloadhis: DownloadHistory = self.downloadhis.get_by_hash(torrent.hash)
@@ -128,7 +128,7 @@ class TransferChain(ChainBase):
self.__do_transfer(
fileitem=FileItem(
storage="local",
path=torrent.path,
path=str(file_path),
type="dir" if not file_path.is_file() else "file",
name=file_path.name,
size=file_path.stat().st_size,

View File

@@ -214,7 +214,7 @@ class QbittorrentModule(_ModuleBase, _DownloaderBase):
if content_path:
torrent_path = Path(content_path)
else:
torrent_path = torrent.get('save_path') / torrent.get('name')
torrent_path = Path(torrent.get('save_path')) / torrent.get('name')
ret_torrents.append(TransferTorrent(
title=torrent.get('name'),
path=torrent_path,