fix: save download client json settings (#79)

This commit is contained in:
Ludvig Lundgren 2022-01-13 21:44:38 +01:00 committed by GitHub
parent 2daeedbdc7
commit d3c0b32199
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,7 +157,7 @@ func (r *DownloadClientRepo) Store(client domain.DownloadClient) (*domain.Downlo
ssl = ?,
username = ?,
password = ?,
settings = json_set(?)
settings = (?)
WHERE
id = ?`,
client.Name,
@ -168,7 +168,7 @@ func (r *DownloadClientRepo) Store(client domain.DownloadClient) (*domain.Downlo
client.SSL,
client.Username,
client.Password,
settingsJson,
string(settingsJson),
client.ID,
)
if err != nil {
@ -189,7 +189,7 @@ func (r *DownloadClientRepo) Store(client domain.DownloadClient) (*domain.Downlo
username,
password,
settings)
VALUES (?, ?, ?, ?, ?, ? , ?, ?, json_set(?)) ON CONFLICT DO NOTHING`,
VALUES (?, ?, ?, ?, ?, ? , ?, ?, ?) ON CONFLICT DO NOTHING`,
client.Name,
client.Type,
client.Enabled,
@ -198,7 +198,7 @@ func (r *DownloadClientRepo) Store(client domain.DownloadClient) (*domain.Downlo
client.SSL,
client.Username,
client.Password,
settingsJson,
string(settingsJson),
)
if err != nil {
log.Error().Stack().Err(err).Msgf("could not store new download client: %v", client)