feat: supports batch operation of tasks by filter (#753)

This commit is contained in:
Levi authored and GitHub committed 2024-09-21 10:19:52 +08:00
1 parent 2dc7048cba
commit bdb8ed177f
7 files changed
+394 -114

No files matched your search

+10
View File
@@ -112,6 +112,16 @@ func (t *Task) calcSpeed(speedArr []int64, downloaded int64, usedTime float64) i
return int64(float64(total) / float64(len(speedArr)) / usedTime)
}
type TaskFilter struct {
IDs []string
Statuses []base.Status
NotStatuses []base.Status
}
func (f *TaskFilter) IsEmpty() bool {
return len(f.IDs) == 0 && len(f.Statuses) == 0 && len(f.NotStatuses) == 0
}
type DownloaderConfig struct {
Controller *controller.Controller
FetchManagers []fetcher.FetcherManager