diff options
Diffstat (limited to 'src/wikiarticle.go')
| -rw-r--r-- | src/wikiarticle.go | 5 |
1 files changed, 5 insertions, 0 deletions
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"]) } } |
