Adversarial review follow-ups on the #193 rerun selection validation:
- RerunCollectionEditor.razor: remove the CollectionType.Playlist
dropdown option — RerunCollection has no PlaylistId column, so the
option previously persisted a broken row and now fails validation.
- RerunCollectionSelectionValidation: replace FindAsync with a
non-tracking AnyAsync(EF.Property<int>("Id") == id) existence check
so nothing is materialized/tracked into the save-path context.
- Tests: pin the deliberate 422-not-404 choice
(ShouldNotBeOfType<NotFoundError>) and cover the unsupported-type
default arm (Playlist -> "Unsupported collection type"), which was
reachable via the Blazor editor.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RerunCollectionRequestMapping.ResolveSelection builds an id-only VM
with no existence check, so CreateRerunCollectionHandler and
UpdateRerunCollectionHandler blindly copied CollectionId /
MultiCollectionId / SmartCollectionId / MediaItemId from the request
onto the RerunCollection FK columns. A bad id persisted a dangling FK
or 500'd at SaveChanges.
Add RerunCollectionSelectionValidation, a shared per-CollectionType
existence check (Collection/MultiCollection/SmartCollection sets, and
subtype-accurate media-item sets: Shows/Seasons/Artists/Movies/
Episodes/MusicVideos/OtherVideos/Songs/Images/RemoteStreams), composed
into both handlers' Validate via the existing .Apply(...) pattern so a
missing/mismatched id now fails validation (422) with a clear message
instead of persisting or 500ing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>