From d3c0b3219988fda774446674f8bc0363651159e6 Mon Sep 17 00:00:00 2001 From: Ludvig Lundgren Date: Thu, 13 Jan 2022 21:44:38 +0100 Subject: [PATCH] fix: save download client json settings (#79) --- internal/database/download_client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/database/download_client.go b/internal/database/download_client.go index 87734ba..a4d9b7c 100644 --- a/internal/database/download_client.go +++ b/internal/database/download_client.go @@ -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)