mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 14:23:42 +00:00
fix: create task with default select files (#374)
This commit is contained in:
1 file changed
+3
-3
@@ -302,9 +302,6 @@ func (d *Downloader) CreateDirect(req *base.Request, opts *base.Options) (taskId
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *Downloader) Create(rrId string, opts *base.Options) (taskId string, err error) {
|
func (d *Downloader) Create(rrId string, opts *base.Options) (taskId string, err error) {
|
||||||
if opts == nil {
|
|
||||||
opts = &base.Options{}
|
|
||||||
}
|
|
||||||
d.fetcherMapLock.RLock()
|
d.fetcherMapLock.RLock()
|
||||||
fetcher, ok := d.fetcherCache[rrId]
|
fetcher, ok := d.fetcherCache[rrId]
|
||||||
d.fetcherMapLock.RUnlock()
|
d.fetcherMapLock.RUnlock()
|
||||||
@@ -750,6 +747,9 @@ func (d *Downloader) doCreate(fetcher fetcher.Fetcher, opts *base.Options) (task
|
|||||||
if opts == nil {
|
if opts == nil {
|
||||||
opts = &base.Options{}
|
opts = &base.Options{}
|
||||||
}
|
}
|
||||||
|
if opts.SelectFiles == nil {
|
||||||
|
opts.SelectFiles = make([]int, 0)
|
||||||
|
}
|
||||||
|
|
||||||
meta := fetcher.Meta()
|
meta := fetcher.Meta()
|
||||||
meta.Opts = opts
|
meta.Opts = opts
|
||||||
|
|||||||
Reference in new issue
Block a user