From ea0c766afccf502d3f8afb0f46080ec4862146f1 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 12 Feb 2023 11:15:01 +0700 Subject: [PATCH] strip year from tv showfilenma end only --- src/tvsort.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tvsort.py b/src/tvsort.py index 5ad8fc5..6d2313d 100644 --- a/src/tvsort.py +++ b/src/tvsort.py @@ -76,10 +76,7 @@ class Static: year_pattern = re.compile(r'\(?[0-9]{4}\)?') year = year_pattern.findall(showname) if year and year[0] != showname: - words = showname.split() - words.remove(year[0]) - if len(words) > 1: - showname = showname.replace(year[0], '').replace("..", ".") + showname = showname.rstrip(year[0]).strip() # find acronym acronym = [i for i in showname.split(".") if len(i) == 1] # clean up