diff options
| author | dev | 2026-06-26 02:01:08 +0200 |
|---|---|---|
| committer | dev | 2026-06-26 02:01:08 +0200 |
| commit | 122a4ec1037dfd027d9f3f7d5d25ce63dfe4450a (patch) | |
| tree | 2c77f1eb329149f1e6adc9bedb67eb1e63107be6 /src/wikidata.go | |
| parent | c9d23f25e10ed054690a8e8eb83f8e742a7533f2 (diff) | |
| download | hnimdbbot-122a4ec1037dfd027d9f3f7d5d25ce63dfe4450a.tar.gz | |
fix: decode wiki article names for clean storage
- wikidata.go: url.PathUnescape SPARQL titles before storing
- wikiarticle.go: PathUnescape on read, PathEscape on send
- DB holds decoded names; URLs are always freshly encoded
Diffstat (limited to 'src/wikidata.go')
| -rw-r--r-- | src/wikidata.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wikidata.go b/src/wikidata.go index 20411d2..c775f1f 100644 --- a/src/wikidata.go +++ b/src/wikidata.go @@ -175,7 +175,7 @@ func (a *App) queryWikidataBatch(ids []string) (map[string]wikiAcc, error) { if n, ok := b["article"]; ok && n.Value != "" { // Extract title from URL: strip "https://en.wikipedia.org/wiki/" - title := strings.TrimPrefix(n.Value, "https://en.wikipedia.org/wiki/") + title, _ := url.PathUnescape(strings.TrimPrefix(n.Value, "https://en.wikipedia.org/wiki/")) results[imdb] = wikiAcc{ wikiArticle: n.Value, title: title, |
