From b8619306e9f1573004b114e453db18f8e1923f79 Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:46:30 +0100 Subject: [PATCH] remove escaping for quote not required anymore --- cmd/piwigo-cli/method_try.go | 2 +- internal/piwigo/files.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/piwigo-cli/method_try.go b/cmd/piwigo-cli/method_try.go index 7cc4b30..ff08bec 100644 --- a/cmd/piwigo-cli/method_try.go +++ b/cmd/piwigo-cli/method_try.go @@ -50,7 +50,7 @@ func ArgsToForm(args []string) (*url.Values, error) { if len(r) != 2 { return nil, errors.New("args should be key=value") } - params.Add(r[0], strings.ReplaceAll(r[1], "'", `\'`)) + params.Add(r[0], r[1]) } return params, nil } diff --git a/internal/piwigo/files.go b/internal/piwigo/files.go index c45704e..0641d17 100644 --- a/internal/piwigo/files.go +++ b/internal/piwigo/files.go @@ -5,7 +5,6 @@ import ( "net/url" "os" "path/filepath" - "strings" "sync" "github.com/celogeek/piwigo-cli/internal/piwigo/piwigotools" @@ -176,7 +175,7 @@ func (p *Piwigo) ScanTree( category = &piwigotools.Category{} p.mu.Lock() err = p.Post("pwg.categories.add", &url.Values{ - "name": []string{strings.ReplaceAll(dirname, "'", `\'`)}, + "name": []string{dirname}, "parent": []string{fmt.Sprint(parentCategoryId)}, }, &category) p.mu.Unlock()