mirror of
https://github.com/dnslin/aria2bot.git
synced 2026-01-11 20:12:20 +08:00
fix: 修复文件名过长的错误
This commit is contained in:
@@ -225,7 +225,7 @@ class Aria2RpcClient:
|
|||||||
return DownloadTask(
|
return DownloadTask(
|
||||||
gid=data.get("gid", ""),
|
gid=data.get("gid", ""),
|
||||||
status=data.get("status", "unknown"),
|
status=data.get("status", "unknown"),
|
||||||
name=name[:40] if len(name) > 40 else name, # 截断文件名
|
name=name, # 保留完整文件名,显示时再截断
|
||||||
total_length=int(data.get("totalLength", 0)),
|
total_length=int(data.get("totalLength", 0)),
|
||||||
completed_length=int(data.get("completedLength", 0)),
|
completed_length=int(data.get("completedLength", 0)),
|
||||||
download_speed=int(data.get("downloadSpeed", 0)),
|
download_speed=int(data.get("downloadSpeed", 0)),
|
||||||
|
|||||||
@@ -778,7 +778,7 @@ class Aria2BotAPI:
|
|||||||
|
|
||||||
local_path = Path(task.dir) / task.name
|
local_path = Path(task.dir) / task.name
|
||||||
if not local_path.exists():
|
if not local_path.exists():
|
||||||
logger.error(f"频道上传失败:本地文件不存在 GID={gid}")
|
logger.error(f"频道上传失败:本地文件不存在 GID={gid}, dir={task.dir}, name={task.name}, path={local_path}")
|
||||||
return
|
return
|
||||||
|
|
||||||
# 检查文件大小
|
# 检查文件大小
|
||||||
|
|||||||
Reference in New Issue
Block a user