diff --git a/wareztb.go b/wareztb.go index 224ceb4..1fcae53 100644 --- a/wareztb.go +++ b/wareztb.go @@ -19,12 +19,12 @@ func GetComparableWarezString(s string) (string, error) { return "", err } - return utils.RemoveDoubledStrings( - strings.ToLower( - fmt.Sprintf("%s.%d", title, year), - ), - ".", - ), nil + result := fmt.Sprintf("%s.%d", title, year) + result = strings.ToLower(result) + result = utils.RemoveDoubledStrings(result, ".") + result = utils.RemoveLeadingStrings(result, ".") + + return result, nil } // GetTitleAndYearFromWarezString tries to get the title and year from a string in a warez context diff --git a/wareztb_test.go b/wareztb_test.go index 68d6f45..fef63ef 100644 --- a/wareztb_test.go +++ b/wareztb_test.go @@ -18,6 +18,7 @@ func TestGetComparableWarezString(t *testing.T) { "Little Britain (2003)": "little.britain.2003", "Sons of Anarchy (2008)": "sons.of.anarchy.2008", "Love, Death & Robots (2019)": "love.death.robots.2019", + "...Jahr 2022... die überleben wollen... (1973)": "jahr.2022.die.ueberleben.wollen.1973", } for d, expectedResult := range data {