chore: pass all options to download
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||
<text x="33.5" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
||||
<text x="33.5" y="14">coverage</text>
|
||||
<text x="86" y="15" fill="#010101" fill-opacity=".3">19.7%</text>
|
||||
<text x="86" y="14">19.7%</text>
|
||||
<text x="86" y="15" fill="#010101" fill-opacity=".3">19.8%</text>
|
||||
<text x="86" y="14">19.8%</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 926 B After Width: | Height: | Size: 926 B |
@ -445,15 +445,15 @@ msgstr ""
|
||||
msgid "Source can be updated, updating if required"
|
||||
msgstr ""
|
||||
|
||||
#: pkg/dl/dl.go:201
|
||||
#: pkg/dl/dl.go:196
|
||||
msgid "Source found in cache and linked to destination"
|
||||
msgstr ""
|
||||
|
||||
#: pkg/dl/dl.go:208
|
||||
#: pkg/dl/dl.go:203
|
||||
msgid "Source updated and linked to destination"
|
||||
msgstr ""
|
||||
|
||||
#: pkg/dl/dl.go:222
|
||||
#: pkg/dl/dl.go:217
|
||||
msgid "Downloading source"
|
||||
msgstr ""
|
||||
|
||||
|
@ -461,15 +461,15 @@ msgstr "Ошибка при запуске приложения"
|
||||
msgid "Source can be updated, updating if required"
|
||||
msgstr "Исходный код можно обновлять, обновляя при необходимости"
|
||||
|
||||
#: pkg/dl/dl.go:201
|
||||
#: pkg/dl/dl.go:196
|
||||
msgid "Source found in cache and linked to destination"
|
||||
msgstr "Источник найден в кэше и связан с пунктом назначения"
|
||||
|
||||
#: pkg/dl/dl.go:208
|
||||
#: pkg/dl/dl.go:203
|
||||
msgid "Source updated and linked to destination"
|
||||
msgstr "Источник обновлён и связан с пунктом назначения"
|
||||
|
||||
#: pkg/dl/dl.go:222
|
||||
#: pkg/dl/dl.go:217
|
||||
msgid "Downloading source"
|
||||
msgstr "Скачивание источника"
|
||||
|
||||
|
26
pkg/dl/dl.go
26
pkg/dl/dl.go
@ -172,15 +172,10 @@ func Download(ctx context.Context, opts Options) (err error) {
|
||||
"downloader", d.Name(),
|
||||
)
|
||||
|
||||
updated, err = d.Update(Options{
|
||||
Hash: opts.Hash,
|
||||
HashAlgorithm: opts.HashAlgorithm,
|
||||
Name: opts.Name,
|
||||
URL: opts.URL,
|
||||
Destination: cacheDir,
|
||||
Progress: opts.Progress,
|
||||
LocalDir: opts.LocalDir,
|
||||
})
|
||||
newOpts := opts
|
||||
newOpts.Destination = cacheDir
|
||||
|
||||
updated, err = d.Update(newOpts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -226,15 +221,10 @@ func Download(ctx context.Context, opts Options) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
t, name, err := d.Download(ctx, Options{
|
||||
Hash: opts.Hash,
|
||||
HashAlgorithm: opts.HashAlgorithm,
|
||||
Name: opts.Name,
|
||||
URL: opts.URL,
|
||||
Destination: cacheDir,
|
||||
Progress: opts.Progress,
|
||||
LocalDir: opts.LocalDir,
|
||||
})
|
||||
newOpts := opts
|
||||
newOpts.Destination = cacheDir
|
||||
|
||||
t, name, err := d.Download(ctx, newOpts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user