fix(458): reject duplicate names on playlist & playlist-group rename #576

Merged
timothy merged 1 commits from feat/458-rename-dup into main 2026-07-23 20:07:43 +02:00
1 Commits
Author SHA1 Message Date
timothyandClaude Opus 4.8 d12da836f2 fix(458): reject duplicate names on playlist & playlist-group rename
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 9s
PR Gates / Docs update reminder (pull_request) Successful in 12s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 13s
PR Gates / decisions lifecycle (pull_request) Successful in 17s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 1m28s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 15m47s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 16m2s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 19m55s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
ReplacePlaylistItemsHandler (playlist rename) and RenamePlaylistGroupHandler
(group rename) validated name non-empty/length but not uniqueness, so a rename
could produce two identically-named siblings even though the create paths reject
duplicates. Mirror the existing ReplaceBlockItems/ReplaceTemplate sibling
pattern: an async BindT step scoped to the group (playlist) or global (group,
matching PlaylistGroup.Name's unique index), self-excluded so a no-op rename to
its own name still succeeds, returning BaseError -> 422 like create.

For groups this also upgrades a would-be raw DbUpdateException (create-group has
no explicit guard, only the DB index) into a clean 422.

Closes #458.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 19:43:58 +02:00