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/wikidata.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wikidata.go') diff --git a/src/wikidata.go b/src/wikidata.go index 3101673..5175d52 100644 --- a/src/wikidata.go +++ b/src/wikidata.go @@ -125,7 +125,7 @@ func (a *App) getExistingWikiArticles() ([]existingWikiArticle, error) { WHERE wiki_article IS NOT NULL AND wiki_status_code != 404 AND (synopsis IS NULL OR description IS NULL OR year IS NULL - OR poster_url IS NULL OR license IS NULL OR license_url IS NULL OR num_accolades IS NULL OR has_people = 0) + OR poster_url IS NULL OR license IS NULL OR license_short IS NULL OR license_url IS NULL OR num_accolades IS NULL OR has_people = 0) `) if err != nil { return nil, fmt.Errorf("query existing wiki articles: %w", err) @@ -254,10 +254,10 @@ func (a *App) wikiDataConsumer(artCh <-chan wikiArticleFetch, done chan<- struct if statusCode == 200 { a.DB.Exec(` UPDATE imdb SET synopsis = ?, description = ?, year = ?, poster_url = ?, - license = ?, license_url = ?, num_accolades = ? + license = ?, license_short = ?, license_url = ?, num_accolades = ? WHERE imdb_id = ?`, entry.Synopsis, entry.Description, entry.Year, entry.PosterURL, - entry.License, entry.LicenseURL, entry.NumAccolades, art.imdbID) + entry.License, entry.LicenseShort, entry.LicenseURL, entry.NumAccolades, art.imdbID) updated++ } -- cgit v1.2.3