下载/主界面优化
This commit is contained in:
@@ -158,9 +158,10 @@ impl DownloadEngine {
|
||||
|
||||
let id = self.inner.storage.next_task_id();
|
||||
|
||||
// 创建分段
|
||||
// 创建分段(受 continue_download 设置控制:关闭时强制单线程、不支持续传)
|
||||
let resume_enabled = settings.continue_download;
|
||||
let segments = match &probe {
|
||||
Ok(p) if p.supports_resume && p.total_size.map(|s| s > 0).unwrap_or(false) => {
|
||||
Ok(p) if resume_enabled && p.supports_resume && p.total_size.map(|s| s > 0).unwrap_or(false) => {
|
||||
split_segments(p.total_size.unwrap(), settings.max_connections)
|
||||
}
|
||||
_ => vec![Segment {
|
||||
@@ -172,7 +173,8 @@ impl DownloadEngine {
|
||||
};
|
||||
|
||||
let total_size = probe.as_ref().ok().and_then(|p| p.total_size).unwrap_or(0);
|
||||
let supports_resume = probe.as_ref().ok().map(|p| p.supports_resume).unwrap_or(false);
|
||||
let supports_resume = resume_enabled
|
||||
&& probe.as_ref().ok().map(|p| p.supports_resume).unwrap_or(false);
|
||||
|
||||
let task = DownloadTask {
|
||||
id: id.clone(),
|
||||
|
||||
Reference in New Issue
Block a user