remove escaping for quote

not required anymore
This commit is contained in:
Celogeek 2024-03-03 17:46:30 +01:00
parent 7969ec305f
commit b8619306e9
Signed by: celogeek
SSH Key Fingerprint: SHA256:njNJLzoLQdbV9PC6ehcruRb0QnEgxABoCYZ+0+aUIYc
2 changed files with 2 additions and 3 deletions

View File

@ -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
}

View File

@ -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()