|
|
@ -234,9 +234,14 @@ func (a *aria2Client) SetFilesToDownload(ctx context.Context, handle *downloader
|
|
|
|
return fmt.Errorf("cannot get task: %w", err)
|
|
|
|
return fmt.Errorf("cannot get task: %w", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
selected := lo.SliceToMap(status.Files, func(item downloader.TaskFile) (int, bool) {
|
|
|
|
selected := lo.SliceToMap(
|
|
|
|
return item.Index, true
|
|
|
|
lo.Filter(status.Files, func(item downloader.TaskFile, _ int) bool {
|
|
|
|
})
|
|
|
|
return item.Selected
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
func(item downloader.TaskFile) (int, bool) {
|
|
|
|
|
|
|
|
return item.Index, true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
for _, arg := range args {
|
|
|
|
for _, arg := range args {
|
|
|
|
if !arg.Download {
|
|
|
|
if !arg.Download {
|
|
|
|
delete(selected, arg.Index)
|
|
|
|
delete(selected, arg.Index)
|
|
|
|