From 2d72767874f6972726ef09082373e6ac01da169a Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 26 Jun 2026 18:36:46 +0200 Subject: feat: add license_short from Wikipedia license identifier - Extract license.identifier (e.g. CC-BY-SA-4.0) into new license_short column - Warn if a license array has more than 1 entry (none seen yet) - Include license_short IS NULL in getExistingWikiArticles query --- src/wikiarticle.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/wikiarticle.go') diff --git a/src/wikiarticle.go b/src/wikiarticle.go index 09c2da8..19f612c 100644 --- a/src/wikiarticle.go +++ b/src/wikiarticle.go @@ -26,6 +26,7 @@ type wikiArticleEntry struct { PosterURL string Synopsis string License string + LicenseShort string LicenseURL string NumAccolades int People []wikiPerson @@ -100,8 +101,12 @@ func (a *App) queryWikiArticle(name string) (wikiArticleEntry, int, error) { // license if licList, ok := article["license"]; ok { if arr, ok := licList.([]interface{}); ok && len(arr) > 0 { + if len(arr) > 1 { + logWarn("license array has %d entries, using first (article %s)", len(arr), name) + } if lic, ok := arr[0].(map[string]interface{}); ok { entry.License = fmt.Sprintf("%v", lic["name"]) + entry.LicenseShort = fmt.Sprintf("%v", lic["identifier"]) entry.LicenseURL = fmt.Sprintf("%v", lic["url"]) } } -- cgit v1.2.3