Allow downloads to be created, prompt the user for a profile.

This commit is contained in:
2021-09-30 23:48:56 +09:30
parent d47e2af2a4
commit fc0d6a32c3
5 changed files with 314 additions and 196 deletions

View File

@@ -65,6 +65,15 @@ func DefaultConfig() *Config {
return &defaultConfig
}
func (c *Config) ProfileCalled(name string) *DownloadProfile {
for _, p := range c.DownloadProfiles {
if p.Name == name {
return &p
}
}
return nil
}
func (c *Config) UpdateFromJSON(j []byte) error {
newConfig := Config{}
err := json.Unmarshal(j, &newConfig)