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
+3
View File
@@ -1,6 +1,9 @@
name: MoviePilot Builder name: MoviePilot Builder
on: on:
workflow_dispatch: workflow_dispatch:
push:
branches:
- dev
jobs: jobs:
Docker-build: Docker-build:
+3 -3
View File
@@ -86,7 +86,7 @@ class TransferChain(ChainBase):
for torrent in torrents: for torrent in torrents:
# 文件路径 # 文件路径
file_path = Path(torrent.path) file_path = torrent.path
if not file_path.exists(): if not file_path.exists():
logger.warn(f"文件不存在:{file_path}") logger.warn(f"文件不存在:{file_path}")
continue continue
@@ -103,7 +103,7 @@ class TransferChain(ChainBase):
if not transfer_dirinfo: if not transfer_dirinfo:
logger.info(f"文件 {file_path} 不在下载器监控目录中,不通过下载器进行整理") logger.info(f"文件 {file_path} 不在下载器监控目录中,不通过下载器进行整理")
# 设置下载任务状态 # 设置下载任务状态
self.transfer_completed(hashs=torrent.hash, path=torrent.path) self.transfer_completed(hashs=torrent.hash, path=file_path)
continue continue
# 查询下载记录识别情况 # 查询下载记录识别情况
downloadhis: DownloadHistory = self.downloadhis.get_by_hash(torrent.hash) downloadhis: DownloadHistory = self.downloadhis.get_by_hash(torrent.hash)
@@ -128,7 +128,7 @@ class TransferChain(ChainBase):
self.__do_transfer( self.__do_transfer(
fileitem=FileItem( fileitem=FileItem(
storage="local", storage="local",
path=torrent.path, path=str(file_path),
type="dir" if not file_path.is_file() else "file", type="dir" if not file_path.is_file() else "file",
name=file_path.name, name=file_path.name,
size=file_path.stat().st_size, size=file_path.stat().st_size,
+1 -1
View File
@@ -214,7 +214,7 @@ class QbittorrentModule(_ModuleBase, _DownloaderBase):
if content_path: if content_path:
torrent_path = Path(content_path) torrent_path = Path(content_path)
else: else:
torrent_path = torrent.get('save_path') / torrent.get('name') torrent_path = Path(torrent.get('save_path')) / torrent.get('name')
ret_torrents.append(TransferTorrent( ret_torrents.append(TransferTorrent(
title=torrent.get('name'), title=torrent.get('name'),
path=torrent_path, path=torrent_path,