From 4bb98a65188de6546a64394f094f3042ac0689e4 Mon Sep 17 00:00:00 2001 From: Andreas Schulte Date: Mon, 23 Oct 2023 23:59:20 +0200 Subject: [PATCH] added support for mini series --- imdb-scraper.go | 5 +++++ imdb-scraper_test.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/imdb-scraper.go b/imdb-scraper.go index 26ced10..294b94a 100644 --- a/imdb-scraper.go +++ b/imdb-scraper.go @@ -150,6 +150,10 @@ func isIMDbTitleOfSeries(title string) bool { return true } + if strings.Contains(title, "(Miniserie ") { + return true + } + if strings.Contains(title, "(TV Series ") { return true } @@ -159,6 +163,7 @@ func isIMDbTitleOfSeries(title string) bool { func prepareChunckOfIMDbTitleOfSeriesForYearExtraction(s string) string { s = strings.Replace(s, "(Fernsehserie ", "(", -1) + s = strings.Replace(s, "(Miniserie ", "(", -1) s = strings.Replace(s, "(TV Series ", "(", -1) sSplitted := strings.Split(s, "–") diff --git a/imdb-scraper_test.go b/imdb-scraper_test.go index ec8103b..2c682ae 100644 --- a/imdb-scraper_test.go +++ b/imdb-scraper_test.go @@ -101,6 +101,11 @@ func TestExtractYearFromIMDbTitle(t *testing.T) { Title: "Rick and Morty", ExpectedResult: 2013, }, + { + Data: "Unser Kosmos: Die Reise geht weiter (Miniserie 2014) - IMDb", + Title: "Unser Kosmos: Die Reise geht weiter", + ExpectedResult: 2014, + }, } for _, r := range data {