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