mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 08:23:28 -03:00
Refactored ItemValue structure
This commit is contained in:
@@ -8,12 +8,22 @@ namespace Jellyfin.Data.Entities;
|
||||
public class AncestorId
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets the AncestorId that may or may not be an database managed Item or an materialised local item.
|
||||
/// Gets or Sets the AncestorId.
|
||||
/// </summary>
|
||||
public required Guid ParentItemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the related that may or may not be an database managed Item or an materialised local item.
|
||||
/// Gets or Sets the related BaseItem.
|
||||
/// </summary>
|
||||
public required Guid ItemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the ParentItem.
|
||||
/// </summary>
|
||||
public required BaseItemEntity ParentItem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the Child item.
|
||||
/// </summary>
|
||||
public required BaseItemEntity Item { get; set; }
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class BaseItemEntity
|
||||
|
||||
public ICollection<UserData>? UserData { get; set; }
|
||||
|
||||
public ICollection<ItemValue>? ItemValues { get; set; }
|
||||
public ICollection<ItemValueMap>? ItemValues { get; set; }
|
||||
|
||||
public ICollection<MediaStreamInfo>? MediaStreams { get; set; }
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Jellyfin.Data.Entities;
|
||||
|
||||
@@ -11,14 +9,9 @@ namespace Jellyfin.Data.Entities;
|
||||
public class ItemValue
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets the reference ItemId.
|
||||
/// Gets or Sets the ItemValueId.
|
||||
/// </summary>
|
||||
public required Guid ItemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the referenced BaseItem.
|
||||
/// </summary>
|
||||
public required BaseItemEntity Item { get; set; }
|
||||
public required Guid ItemValueId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the Type.
|
||||
@@ -34,4 +27,11 @@ public class ItemValue
|
||||
/// Gets or Sets the sanatised Value.
|
||||
/// </summary>
|
||||
public required string CleanValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets all associated BaseItems.
|
||||
/// </summary>
|
||||
#pragma warning disable CA2227 // Collection properties should be read only
|
||||
public ICollection<ItemValueMap>? BaseItemsMap { get; set; }
|
||||
#pragma warning restore CA2227 // Collection properties should be read only
|
||||
}
|
||||
|
||||
30
Jellyfin.Data/Entities/ItemValueMap.cs
Normal file
30
Jellyfin.Data/Entities/ItemValueMap.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Jellyfin.Data.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Mapping table for the ItemValue BaseItem relation.
|
||||
/// </summary>
|
||||
public class ItemValueMap
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets the ItemId.
|
||||
/// </summary>
|
||||
public required Guid ItemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the ItemValueId.
|
||||
/// </summary>
|
||||
public required Guid ItemValueId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the referenced <see cref="BaseItemEntity"/>.
|
||||
/// </summary>
|
||||
public required BaseItemEntity Item { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the referenced <see cref="ItemValue"/>.
|
||||
/// </summary>
|
||||
public required ItemValue ItemValue { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user