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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user