Added BaseItem Configuration

pull/12798/head
JPVenson 4 months ago
parent 2014fa56b8
commit 3dc4024338

@ -16,8 +16,6 @@ public class BaseItemEntity
public string? Data { get; set; }
public Guid? ParentId { get; set; }
public string? Path { get; set; }
public DateTime StartDate { get; set; }
@ -94,8 +92,6 @@ public class BaseItemEntity
public string? UnratedType { get; set; }
public Guid? TopParentId { get; set; }
public string? TrailerTypes { get; set; }
public float? CriticRating { get; set; }
@ -124,10 +120,6 @@ public class BaseItemEntity
public string? SeasonName { get; set; }
public Guid? SeasonId { get; set; }
public Guid? SeriesId { get; set; }
public string? ExternalSeriesId { get; set; }
public string? Tagline { get; set; }
@ -160,6 +152,22 @@ public class BaseItemEntity
public long? Size { get; set; }
public Guid? ParentId { get; set; }
public BaseItemEntity? Parent { get; set; }
public Guid? TopParentId { get; set; }
public BaseItemEntity? TopParent { get; set; }
public Guid? SeasonId { get; set; }
public BaseItemEntity? Season { get; set; }
public Guid? SeriesId { get; set; }
public BaseItemEntity? Series { get; set; }
#pragma warning disable CA2227 // Collection properties should be read only
public ICollection<People>? Peoples { get; set; }

@ -8,7 +8,7 @@ namespace Jellyfin.Data.Entities;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public class Chapter
{
public Guid ItemId { get; set; }
public required Guid ItemId { get; set; }
public required BaseItemEntity Item { get; set; }

@ -13,7 +13,7 @@ public class ItemValue
/// <summary>
/// Gets or Sets the reference ItemId.
/// </summary>
public Guid ItemId { get; set; }
public required Guid ItemId { get; set; }
/// <summary>
/// Gets or Sets the referenced BaseItem.

@ -5,7 +5,7 @@ namespace Jellyfin.Data.Entities;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public class MediaStreamInfo
{
public Guid ItemId { get; set; }
public required Guid ItemId { get; set; }
public required BaseItemEntity Item { get; set; }

@ -13,7 +13,19 @@ public class BaseItemConfiguration : IEntityTypeConfiguration<BaseItemEntity>
/// <inheritdoc/>
public void Configure(EntityTypeBuilder<BaseItemEntity> builder)
{
builder.HasNoKey();
builder.HasKey(e => e.Id);
builder.HasOne(e => e.Parent);
builder.HasOne(e => e.TopParent);
builder.HasOne(e => e.Season);
builder.HasOne(e => e.Series);
builder.HasMany(e => e.Peoples);
builder.HasMany(e => e.UserData);
builder.HasMany(e => e.ItemValues);
builder.HasMany(e => e.MediaStreams);
builder.HasMany(e => e.Chapters);
builder.HasMany(e => e.Provider);
builder.HasMany(e => e.AncestorIds);
builder.HasIndex(e => e.Path);
builder.HasIndex(e => e.ParentId);
builder.HasIndex(e => e.PresentationUniqueKey);

Loading…
Cancel
Save