mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #13821] [MERGED] Explicitly set default value for enums used in API models #13725
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/13821
Author: @gnattu
Created: 3/31/2025
Status: ✅ Merged
Merged: 4/1/2025
Merged by: @crobibero
Base:
master← Head:explicit-api-model-default📝 Commits (1)
c25bd5eExplicitly set default value for enums used in API models📊 Changes
5 files changed (+9 additions, -0 deletions)
View changed files
📝
MediaBrowser.Model/Dto/BaseItemDto.cs(+2 -0)📝
MediaBrowser.Model/Dto/BaseItemPerson.cs(+2 -0)📝
MediaBrowser.Model/Entities/MediaStream.cs(+1 -0)📝
MediaBrowser.Model/MediaSegments/MediaSegmentDto.cs(+2 -0)📝
MediaBrowser.Model/Search/SearchHint.cs(+2 -0)📄 Description
Enums in response model with no nullability or default value will make the API very fragile as each extension to the enum will break the API for some clients, but a lot of enums actually do have an unknown value which should be used as a default. This set all model properties that are non-nullable using an enum that has an Unknown member in 10.10, except MediaStream.VideoRangeType which is refactored in #13277
Changes
Issues
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.