mirror of
https://github.com/hyb-oyqq/FRAISEMOE-Addons-Installer-NEXT.git
synced 2025-12-17 12:30:27 +00:00
feat(core): 添加下载线程设置功能
- 在下载管理器中引入下载线程级别设置,支持用户自定义线程数 - 在主菜单中添加下载设置子菜单,包含修改下载源和下载线程设置选项 - 优化下载流程,动态调整下载线程数以提高下载效率 - 在动画过程中禁用相关按钮,确保用户体验流畅 - 更新配置文件,增加下载线程档位设置
This commit is contained in:
@@ -154,6 +154,12 @@ class DownloadThread(QThread):
|
||||
aria2c_path,
|
||||
]
|
||||
|
||||
# 获取主窗口的下载管理器对象
|
||||
thread_count = 64 # 默认值
|
||||
if hasattr(self.parent(), 'download_manager'):
|
||||
# 从下载管理器获取线程数设置
|
||||
thread_count = self.parent().download_manager.get_download_thread_count()
|
||||
|
||||
# 将所有的优化参数应用于每个下载任务
|
||||
command.extend([
|
||||
'--dir', download_dir,
|
||||
@@ -181,7 +187,7 @@ class DownloadThread(QThread):
|
||||
'--auto-file-renaming=false',
|
||||
'--allow-overwrite=true',
|
||||
'--split=128',
|
||||
'--max-connection-per-server=64',
|
||||
f'--max-connection-per-server={thread_count}', # 使用动态的线程数
|
||||
'--min-split-size=1M', # 减小最小分片大小
|
||||
'--optimize-concurrent-downloads=true', # 优化并发下载
|
||||
'--file-allocation=none', # 禁用文件预分配加快开始
|
||||
|
||||
Reference in New Issue
Block a user