fix: strip all trailing year suffixes to prevent duplication

- series.py: use regex to remove all trailing (YYYY) before appending year
- nfo_service.py: _extract_year_from_name strips all trailing year suffixes
- nfo_repair_service.py: add _read_tmdb_id() helper to extract TMDB ID from NFO
This commit is contained in:
2026-05-20 19:38:37 +02:00
parent 7930e49701
commit 51be777e7d
3 changed files with 38 additions and 5 deletions

View File

@@ -271,10 +271,11 @@ class Serie:
'Dororo (2025)'
"""
if self._year:
import re
year_suffix = f" ({self._year})"
if self._name.endswith(year_suffix):
return self._name
return f"{self._name}{year_suffix}"
# Strip ALL trailing year suffixes before appending to prevent duplication
clean_name = re.sub(r'(\s*\(\d{4}\))+\s*$', '', self._name).strip()
return f"{clean_name}{year_suffix}"
return self._name
@property