Skip to content

The Free Software Media System - Server Backend & API

Fix FindExtras overwriting current extra type (#11260)

Niels van Velzend9fe900952db
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index a2abafd2ae..0c854bdb74 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -2677,7 +2677,12 @@ namespace Emby.Server.Implementations.Library
extra = itemById;
}
- extra.ExtraType = extraType;
+ // Only update extra type if it is more specific then the currently known extra type
+ if (extra.ExtraType is null or ExtraType.Unknown || extraType != ExtraType.Unknown)
+ {
+ extra.ExtraType = extraType;
+ }
+
extra.ParentId = Guid.Empty;
extra.OwnerId = owner.Id;
return extra;