aboutsummaryrefslogtreecommitdiff
path: root/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildEntity.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-01-17 15:02:26 +0100
committerShadowghost <Ghost_of_Stone@web.de>2026-01-18 19:46:37 +0100
commitcc2ccd1bf344ec38059164d1aa9b261e50807eac (patch)
tree5384fe332d2a24089e2a268b81899affb14a49f9 /src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildEntity.cs
parent1491494bcb8764e48133123226a8e025c5357474 (diff)
Add LinkedChildren database table for normalized relationships
Introduces a new database table to store linked child relationships for boxsets, playlists, and video alternate versions. This replaces the JSON-serialized Data column approach with a proper relational structure. - Add LinkedChildEntity and LinkedChildType enum - Add entity configuration with proper foreign keys - Add EF Core migration for SQLite
Diffstat (limited to 'src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildEntity.cs')
-rw-r--r--src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildEntity.cs39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildEntity.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildEntity.cs
new file mode 100644
index 0000000000..7361775711
--- /dev/null
+++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildEntity.cs
@@ -0,0 +1,39 @@
+using System;
+
+namespace Jellyfin.Database.Implementations.Entities;
+
+/// <summary>
+/// Represents a linked child relationship between items (e.g., BoxSet to Movies, Playlist to tracks).
+/// </summary>
+public class LinkedChildEntity
+{
+ /// <summary>
+ /// Gets or sets the parent item ID (BoxSet, Playlist, etc.).
+ /// </summary>
+ public required Guid ParentId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the child item ID.
+ /// </summary>
+ public required Guid ChildId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the type of linked child (Manual or Shortcut).
+ /// </summary>
+ public required LinkedChildType ChildType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sort order.
+ /// </summary>
+ public int? SortOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the parent item navigation property.
+ /// </summary>
+ public BaseItemEntity? Parent { get; set; }
+
+ /// <summary>
+ /// Gets or sets the child item navigation property.
+ /// </summary>
+ public BaseItemEntity? Child { get; set; }
+}