fix: prevent duplicate year suffixes in series name and folder creation
Apply the same duplicate-year prevention logic to additional code paths: - Serie.name_with_year property: skip adding year suffix if name already ends with it - add_series API endpoint: avoid duplicating year in folder_name_with_year - Add integration test for Serie.name_with_year idempotency - Add API test for add_series endpoint year deduplication Complements the folder_rename_service fix for comprehensive coverage.
This commit is contained in:
@@ -730,7 +730,11 @@ async def add_series(
|
||||
|
||||
# Create folder name with year if available
|
||||
if year:
|
||||
folder_name_with_year = f"{name} ({year})"
|
||||
year_suffix = f" ({year})"
|
||||
if name.endswith(year_suffix):
|
||||
folder_name_with_year = name
|
||||
else:
|
||||
folder_name_with_year = f"{name}{year_suffix}"
|
||||
else:
|
||||
folder_name_with_year = name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user