realtime AddToDownloadList
This commit is contained in:
parent
825cbd15f8
commit
d72144d8c8
@ -86,12 +86,8 @@ func (a *App) ContinueDownload(url string) {
|
|||||||
|
|
||||||
func (a *App) AddToDownloadList(path string, url string) {
|
func (a *App) AddToDownloadList(path string, url string) {
|
||||||
if !existsInDownloadList(url) {
|
if !existsInDownloadList(url) {
|
||||||
client := grab.NewClient()
|
|
||||||
req, _ := grab.NewRequest(path, url)
|
|
||||||
resp := client.Do(req)
|
|
||||||
|
|
||||||
downloadList = append(downloadList, DownloadStatus{
|
downloadList = append(downloadList, DownloadStatus{
|
||||||
resp: resp,
|
resp: nil,
|
||||||
Name: filepath.Base(path),
|
Name: filepath.Base(path),
|
||||||
Path: path,
|
Path: path,
|
||||||
Url: url,
|
Url: url,
|
||||||
@ -102,6 +98,7 @@ func (a *App) AddToDownloadList(path string, url string) {
|
|||||||
Downloading: true,
|
Downloading: true,
|
||||||
Done: false,
|
Done: false,
|
||||||
})
|
})
|
||||||
|
a.ContinueDownload(url)
|
||||||
} else {
|
} else {
|
||||||
a.ContinueDownload(url)
|
a.ContinueDownload(url)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user