UpdateItem as a full overwrite with a fixed write whitelistPOST /Items/{itemId} is the only metadata write path in the Jellyfin API. Its
implementation assigns every field unconditionally, for example
item.Name = request.Name, item.Genres = request.Genres,
item.ProviderIds = request.ProviderIds. It is not a JSON Merge Patch: a field
omitted from the body is written as null or empty.
Some fields also have surprising side effects. Tags written to a MusicAlbum
are unioned onto and subtracted from every child track. Setting LockData on a
folder cascades recursively to all children. ArtistItems/AlbumArtists are the
write source for the internal Artists/AlbumArtists arrays, so an incomplete
list drops artist links.
Define a single explicit WRITABLE_FIELDS whitelist and always send a body that
contains every key in it. The body is built from a fresh read of the item,
with accepted changes layered on top; every rejected key carries its current
value verbatim.
Invariant, asserted in the domain layer and in a contract test:
set(payload) == set(WRITABLE_FIELDS)
ArtistItems, AlbumArtists and Album are excluded from the whitelist for v1.
BaseItemDto. Rejected: it would push
server-computed values (counts, image tags, media sources) back at the server,
and the blast radius of a mistake is the whole item.