aboutsummaryrefslogtreecommitdiff
path: root/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities')
-rw-r--r--src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs26
-rw-r--r--src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildEntity.cs39
-rw-r--r--src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildType.cs27
3 files changed, 88 insertions, 4 deletions
diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs
index d58466e5ca..76c847e5f0 100644
--- a/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs
+++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/BaseItemEntity.cs
@@ -96,7 +96,7 @@ public class BaseItemEntity
public string? OriginalTitle { get; set; }
- public string? PrimaryVersionId { get; set; }
+ public Guid? PrimaryVersionId { get; set; }
public DateTime? DateLastMediaAdded { get; set; }
@@ -118,8 +118,6 @@ public class BaseItemEntity
public string? ProductionLocations { get; set; }
- public string? ExtraIds { get; set; }
-
public int? TotalBitrate { get; set; }
public BaseItemExtraType? ExtraType { get; set; }
@@ -134,7 +132,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; }
@@ -178,6 +186,16 @@ public class BaseItemEntity
public ICollection<BaseItemImageInfo>? Images { get; set; }
+ /// <summary>
+ /// Gets or sets the linked children (for BoxSets, Playlists, etc.).
+ /// </summary>
+ public ICollection<LinkedChildEntity>? LinkedChildEntities { get; set; }
+
+ /// <summary>
+ /// Gets or sets the items this entity is linked to as a child.
+ /// </summary>
+ public ICollection<LinkedChildEntity>? LinkedChildOfEntities { get; set; }
+
// those are references to __LOCAL__ ids not DB ids ... TODO: Bring the whole folder structure into the DB
// public ICollection<BaseItemEntity>? SeriesEpisodes { get; set; }
// public BaseItemEntity? Series { get; set; }
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; }
+}
diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildType.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildType.cs
new file mode 100644
index 0000000000..09b4b84aba
--- /dev/null
+++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/LinkedChildType.cs
@@ -0,0 +1,27 @@
+namespace Jellyfin.Database.Implementations.Entities;
+
+/// <summary>
+/// The linked child type.
+/// </summary>
+public enum LinkedChildType
+{
+ /// <summary>
+ /// Manually linked child.
+ /// </summary>
+ Manual = 0,
+
+ /// <summary>
+ /// Shortcut linked child.
+ /// </summary>
+ Shortcut = 1,
+
+ /// <summary>
+ /// Local alternate version (same item, different file path).
+ /// </summary>
+ LocalAlternateVersion = 2,
+
+ /// <summary>
+ /// Linked alternate version (different item ID).
+ /// </summary>
+ LinkedAlternateVersion = 3
+}