[PR #5943] [MERGED] Nullability handling for device profile classes #10560

Closed
opened 2025-12-22 08:07:47 +01:00 by backuprepo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/5943
Author: @Maxr1998
Created: 5/1/2021
Status: Merged
Merged: 5/4/2021
Merged by: @Bond-009

Base: masterHead: device-profile-defaults


📝 Commits (3)

  • 70771fd Nullability handling for device profile classes
  • 244ad5b Apply review feedback
  • b2bb062 Revert shortened 'is ... or' check

📊 Changes

6 files changed (+115 additions, -124 deletions)

View changed files

📝 Emby.Dlna/Didl/DidlBuilder.cs (+19 -7)
📝 Jellyfin.Api/Controllers/UniversalAudioController.cs (+3 -3)
📝 MediaBrowser.Model/Dlna/ContainerProfile.cs (+19 -44)
📝 MediaBrowser.Model/Dlna/DeviceProfile.cs (+48 -60)
📝 MediaBrowser.Model/Dlna/DirectPlayProfile.cs (+5 -4)
📝 MediaBrowser.Model/Dlna/TranscodingProfile.cs (+21 -6)

📄 Description

Refactored some classes in the device profile model to handle nullability and added DefaultValue and Required attributes for the generated API.
Some properties (like MinSegments in TranscodingProfile) couldn't be made nullable as that would break parsing device profile XMLs.
I also moved some initializers directly to the variables, if constructor assignment is preferred I can also move them back.

Also fixed a bug in the ContainsContainer method, passing a null/empty profileContainers would have caused the method to always return true, which seems to be wrong. Now it properly returns the correct value according to isNegativeList.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/5943 **Author:** [@Maxr1998](https://github.com/Maxr1998) **Created:** 5/1/2021 **Status:** ✅ Merged **Merged:** 5/4/2021 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `device-profile-defaults` --- ### 📝 Commits (3) - [`70771fd`](https://github.com/jellyfin/jellyfin/commit/70771fdcd60ec5d8a9f13713662778c7e57d0633) Nullability handling for device profile classes - [`244ad5b`](https://github.com/jellyfin/jellyfin/commit/244ad5b22577efa4dc737db549e62e422f42449e) Apply review feedback - [`b2bb062`](https://github.com/jellyfin/jellyfin/commit/b2bb062ced57870eb0a116a9518685a8bae48131) Revert shortened 'is ... or' check ### 📊 Changes **6 files changed** (+115 additions, -124 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Dlna/Didl/DidlBuilder.cs` (+19 -7) 📝 `Jellyfin.Api/Controllers/UniversalAudioController.cs` (+3 -3) 📝 `MediaBrowser.Model/Dlna/ContainerProfile.cs` (+19 -44) 📝 `MediaBrowser.Model/Dlna/DeviceProfile.cs` (+48 -60) 📝 `MediaBrowser.Model/Dlna/DirectPlayProfile.cs` (+5 -4) 📝 `MediaBrowser.Model/Dlna/TranscodingProfile.cs` (+21 -6) </details> ### 📄 Description Refactored some classes in the device profile model to handle nullability and added `DefaultValue` and `Required` attributes for the generated API. Some properties (like `MinSegments` in `TranscodingProfile`) couldn't be made nullable as that would break parsing device profile XMLs. I also moved some initializers directly to the variables, if constructor assignment is preferred I can also move them back. Also fixed a bug in the `ContainsContainer` method, passing a null/empty `profileContainers` would have caused the method to always return true, which seems to be wrong. Now it properly returns the correct value according to `isNegativeList`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
backuprepo 2025-12-22 08:07:47 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#10560
No description provided.