added support for mini series

This commit is contained in:
Andreas Schulte 2023-10-23 23:59:20 +02:00
parent b4fb15cf15
commit 4bb98a6518
Signed by: andreas
GPG Key ID: DCD1B6A247B69DB6
2 changed files with 10 additions and 0 deletions

View File

@ -150,6 +150,10 @@ func isIMDbTitleOfSeries(title string) bool {
return true return true
} }
if strings.Contains(title, "(Miniserie ") {
return true
}
if strings.Contains(title, "(TV Series ") { if strings.Contains(title, "(TV Series ") {
return true return true
} }
@ -159,6 +163,7 @@ func isIMDbTitleOfSeries(title string) bool {
func prepareChunckOfIMDbTitleOfSeriesForYearExtraction(s string) string { func prepareChunckOfIMDbTitleOfSeriesForYearExtraction(s string) string {
s = strings.Replace(s, "(Fernsehserie ", "(", -1) s = strings.Replace(s, "(Fernsehserie ", "(", -1)
s = strings.Replace(s, "(Miniserie ", "(", -1)
s = strings.Replace(s, "(TV Series ", "(", -1) s = strings.Replace(s, "(TV Series ", "(", -1)
sSplitted := strings.Split(s, "") sSplitted := strings.Split(s, "")

View File

@ -101,6 +101,11 @@ func TestExtractYearFromIMDbTitle(t *testing.T) {
Title: "Rick and Morty", Title: "Rick and Morty",
ExpectedResult: 2013, 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 { for _, r := range data {