aboutsummaryrefslogtreecommitdiff
path: root/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-01-17 15:06:10 +0100
committerShadowghost <Ghost_of_Stone@web.de>2026-01-18 19:46:37 +0100
commit139d23ddc29b6bafad5f8e6ba9eddc8484ab0713 (patch)
tree4d2d56f9d524c20c65ca9369dac530c9a1f70b43 /src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs
parentcc2ccd1bf344ec38059164d1aa9b261e50807eac (diff)
Normalize OwnerId to GUID and add performance indexes
- Change OwnerId from string to Guid for proper foreign key relationships - Add Owner/Extras navigation properties for extras relationship - Add indexes on OwnerId and ExtraType columns for efficient queries - Add optimized composite indexes for latest items queries sorted by DateCreated - Update BaseItemRepository and migration to handle new Guid type
Diffstat (limited to 'src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs')
-rw-r--r--src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs
index 73e6e338ec..c51f331366 100644
--- a/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs
+++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs
@@ -134,7 +134,17 @@ public class BaseItemEntity
public string? ShowId { get; set; }
- public string? OwnerId { get; set; }
+ public Guid? OwnerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the owner item (for extras like trailers, theme songs, etc.).
+ /// </summary>
+ public BaseItemEntity? Owner { get; set; }
+
+ /// <summary>
+ /// Gets or sets the extras owned by this item (trailers, theme songs, behind the scenes, etc.).
+ /// </summary>
+ public ICollection<BaseItemEntity>? Extras { get; set; }
public int? Width { get; set; }