fix: persist movie format flags, add VHS and Digital formats#86
Merged
Conversation
mforce
commented
Jun 1, 2026
mforce
left a comment
Owner
Author
There was a problem hiding this comment.
One doc follow-up before this disappears into the merge mist:
docs/data-model.md still says “All enums serialize as strings (already configured globally via JsonStringEnumConverter).” This PR intentionally makes movie formats cross the wire as an integer bitmask instead, and the issue is specifically about that contract. Please update the docs to call out MovieFormat/movie formats as the exception, otherwise the next pass through the data model docs could easily reintroduce the string enum behavior.
Code-wise this looks good to me: the DTO boundary now returns numeric flags, the new values are power-of-two flags, and the raw JSON integration tests cover create/update/new-format round-trips.
The frontend sends 'formats' as a bitwise integer (e.g. 3 for Dvd|BluRay) but the global JsonStringEnumConverter expected a string like "Dvd, BluRay" and silently fell back to None (0). Changing the DTO property from MovieFormat to int lets the integer pass through JSON unchanged. Also adds Vhs (8) and Digital (16) to the [Flags] enum. Closes #85
9fcfd03 to
875a4c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes movie format checkboxes not persisting after save, and adds two new formats: VHS and Digital.
Tracking issue: Closes #85
Bug fix
The frontend sends
formatsas a bitwise integer (e.g.3for DVD | Blu-ray) viafetch. The server's globalJsonStringEnumConverterexpected a string like"Dvd, BluRay"and silently fell back toNone(0) when it received a number. Every format selection was lost on save.Fix: Changed
MovieDto.FormatsfromMovieFormattointso the integer passes through JSON unchanged. Internal casts inToDto/ApplyDtokeep the domain model intact.New formats
Added
Vhs = 8andDigital = 16to the[Flags]MovieFormatenum. They appear as independent toggle buttons on the movie form alongside the existing DVD / Blu-ray / UHD Blu-ray options.Verification
Files changed
Collectify.Domain/Enums/MovieFormat.csVhs,DigitalCollectify.Api/Endpoints/MoviesEndpoints.csFormats→int, cast internallyclient/services/types.tstests/Api/MoviesEndpointsTests.cs