diff options
| author | JPVenson <github@jpb.email> | 2024-10-09 23:01:54 +0000 |
|---|---|---|
| committer | JPVenson <github@jpb.email> | 2024-10-09 23:01:54 +0000 |
| commit | eb601e944cd392a8007b540ab5627977a37368c6 (patch) | |
| tree | 35ad8f5a89224a16ad47a37b437b8e507ef9c0ae /Jellyfin.Data | |
| parent | f1ae7640414da9cf87124460fd0dbc341c1c90fb (diff) | |
Expanded BaseItem aggregate types
Diffstat (limited to 'Jellyfin.Data')
| -rw-r--r-- | Jellyfin.Data/Entities/BaseItemEntity.cs | 22 | ||||
| -rw-r--r-- | Jellyfin.Data/Entities/BaseItemExtraType.cs | 18 | ||||
| -rw-r--r-- | Jellyfin.Data/Entities/BaseItemImageInfo.cs | 57 | ||||
| -rw-r--r-- | Jellyfin.Data/Entities/BaseItemMetadataField.cs | 26 | ||||
| -rw-r--r-- | Jellyfin.Data/Entities/BaseItemTrailerType.cs | 25 | ||||
| -rw-r--r-- | Jellyfin.Data/Entities/EnumLikeTable.cs | 14 | ||||
| -rw-r--r-- | Jellyfin.Data/Entities/ImageInfoImageType.cs | 76 | ||||
| -rw-r--r-- | Jellyfin.Data/Entities/ProgramAudioEntity.cs | 37 |
8 files changed, 263 insertions, 12 deletions
diff --git a/Jellyfin.Data/Entities/BaseItemEntity.cs b/Jellyfin.Data/Entities/BaseItemEntity.cs index dbe5a5372..cd1991891 100644 --- a/Jellyfin.Data/Entities/BaseItemEntity.cs +++ b/Jellyfin.Data/Entities/BaseItemEntity.cs @@ -10,9 +10,7 @@ namespace Jellyfin.Data.Entities; public class BaseItemEntity { - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - - public Guid Id { get; set; } + public required Guid Id { get; set; } public required string Type { get; set; } @@ -78,12 +76,8 @@ public class BaseItemEntity public bool IsInMixedFolder { get; set; } - public string? LockedFields { get; set; } - public string? Studios { get; set; } - public string? Audio { get; set; } - public string? ExternalServiceId { get; set; } public string? Tags { get; set; } @@ -94,8 +88,6 @@ public class BaseItemEntity public string? UnratedType { get; set; } - public string? TrailerTypes { get; set; } - public float? CriticRating { get; set; } public string? CleanName { get; set; } @@ -126,15 +118,13 @@ public class BaseItemEntity public string? Tagline { get; set; } - public string? Images { get; set; } - public string? ProductionLocations { get; set; } public string? ExtraIds { get; set; } public int? TotalBitrate { get; set; } - public string? ExtraType { get; set; } + public BaseItemExtraType? ExtraType { get; set; } public string? Artists { get; set; } @@ -154,6 +144,8 @@ public class BaseItemEntity public long? Size { get; set; } + public ProgramAudioEntity? Audio { get; set; } + public Guid? ParentId { get; set; } public Guid? TopParentId { get; set; } @@ -176,6 +168,12 @@ public class BaseItemEntity public ICollection<AncestorId>? AncestorIds { get; set; } + public ICollection<BaseItemMetadataField>? LockedFields { get; set; } + + public ICollection<BaseItemTrailerType>? TrailerTypes { get; set; } + + public ICollection<BaseItemImageInfo>? Images { 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/Jellyfin.Data/Entities/BaseItemExtraType.cs b/Jellyfin.Data/Entities/BaseItemExtraType.cs new file mode 100644 index 000000000..341697436 --- /dev/null +++ b/Jellyfin.Data/Entities/BaseItemExtraType.cs @@ -0,0 +1,18 @@ +namespace Jellyfin.Data.Entities; + +#pragma warning disable CS1591 +public enum BaseItemExtraType +{ + Unknown = 0, + Clip = 1, + Trailer = 2, + BehindTheScenes = 3, + DeletedScene = 4, + Interview = 5, + Scene = 6, + Sample = 7, + ThemeSong = 8, + ThemeVideo = 9, + Featurette = 10, + Short = 11 +} diff --git a/Jellyfin.Data/Entities/BaseItemImageInfo.cs b/Jellyfin.Data/Entities/BaseItemImageInfo.cs new file mode 100644 index 000000000..6390cac58 --- /dev/null +++ b/Jellyfin.Data/Entities/BaseItemImageInfo.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; + +namespace Jellyfin.Data.Entities; +#pragma warning disable CA2227 + +/// <summary> +/// Enum TrailerTypes. +/// </summary> +public class BaseItemImageInfo +{ + /// <summary> + /// Gets or Sets. + /// </summary> + public required Guid Id { get; set; } + + /// <summary> + /// Gets or Sets the path to the original image. + /// </summary> + public required string Path { get; set; } + + /// <summary> + /// Gets or Sets the time the image was last modified. + /// </summary> + public DateTime DateModified { get; set; } + + /// <summary> + /// Gets or Sets the imagetype. + /// </summary> + public ImageInfoImageType ImageType { get; set; } + + /// <summary> + /// Gets or Sets the width of the original image. + /// </summary> + public int Width { get; set; } + + /// <summary> + /// Gets or Sets the height of the original image. + /// </summary> + public int Height { get; set; } + +#pragma warning disable CA1819 + /// <summary> + /// Gets or Sets the blurhash. + /// </summary> + public byte[]? Blurhash { get; set; } + + /// <summary> + /// Gets or Sets the reference id to the BaseItem. + /// </summary> + public required Guid ItemId { get; set; } + + /// <summary> + /// Gets or Sets the referenced Item. + /// </summary> + public required BaseItemEntity Item { get; set; } +} diff --git a/Jellyfin.Data/Entities/BaseItemMetadataField.cs b/Jellyfin.Data/Entities/BaseItemMetadataField.cs new file mode 100644 index 000000000..2f8e910f2 --- /dev/null +++ b/Jellyfin.Data/Entities/BaseItemMetadataField.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; + +namespace Jellyfin.Data.Entities; +#pragma warning disable CA2227 + +/// <summary> +/// Enum MetadataFields. +/// </summary> +public class BaseItemMetadataField +{ + /// <summary> + /// Gets or Sets Numerical ID of this enumeratable. + /// </summary> + public required int Id { get; set; } + + /// <summary> + /// Gets or Sets all referenced <see cref="BaseItemEntity"/>. + /// </summary> + public required Guid ItemId { get; set; } + + /// <summary> + /// Gets or Sets all referenced <see cref="BaseItemEntity"/>. + /// </summary> + public required BaseItemEntity Item { get; set; } +} diff --git a/Jellyfin.Data/Entities/BaseItemTrailerType.cs b/Jellyfin.Data/Entities/BaseItemTrailerType.cs new file mode 100644 index 000000000..7dee20c87 --- /dev/null +++ b/Jellyfin.Data/Entities/BaseItemTrailerType.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace Jellyfin.Data.Entities; +#pragma warning disable CA2227 +/// <summary> +/// Enum TrailerTypes. +/// </summary> +public class BaseItemTrailerType +{ + /// <summary> + /// Gets or Sets Numerical ID of this enumeratable. + /// </summary> + public required int Id { get; set; } + + /// <summary> + /// Gets or Sets all referenced <see cref="BaseItemEntity"/>. + /// </summary> + public required Guid ItemId { get; set; } + + /// <summary> + /// Gets or Sets all referenced <see cref="BaseItemEntity"/>. + /// </summary> + public required BaseItemEntity Item { get; set; } +} diff --git a/Jellyfin.Data/Entities/EnumLikeTable.cs b/Jellyfin.Data/Entities/EnumLikeTable.cs new file mode 100644 index 000000000..11e1d0aa9 --- /dev/null +++ b/Jellyfin.Data/Entities/EnumLikeTable.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace Jellyfin.Data.Entities; + +/// <summary> +/// Defines an Entity that is modeled after an Enum. +/// </summary> +public abstract class EnumLikeTable +{ + /// <summary> + /// Gets or Sets Numerical ID of this enumeratable. + /// </summary> + public required int Id { get; set; } +} diff --git a/Jellyfin.Data/Entities/ImageInfoImageType.cs b/Jellyfin.Data/Entities/ImageInfoImageType.cs new file mode 100644 index 000000000..f78178dd2 --- /dev/null +++ b/Jellyfin.Data/Entities/ImageInfoImageType.cs @@ -0,0 +1,76 @@ +namespace Jellyfin.Data.Entities; + +/// <summary> +/// Enum ImageType. +/// </summary> +public enum ImageInfoImageType +{ + /// <summary> + /// The primary. + /// </summary> + Primary = 0, + + /// <summary> + /// The art. + /// </summary> + Art = 1, + + /// <summary> + /// The backdrop. + /// </summary> + Backdrop = 2, + + /// <summary> + /// The banner. + /// </summary> + Banner = 3, + + /// <summary> + /// The logo. + /// </summary> + Logo = 4, + + /// <summary> + /// The thumb. + /// </summary> + Thumb = 5, + + /// <summary> + /// The disc. + /// </summary> + Disc = 6, + + /// <summary> + /// The box. + /// </summary> + Box = 7, + + /// <summary> + /// The screenshot. + /// </summary> + /// <remarks> + /// This enum value is obsolete. + /// XmlSerializer does not serialize/deserialize objects that are marked as [Obsolete]. + /// </remarks> + Screenshot = 8, + + /// <summary> + /// The menu. + /// </summary> + Menu = 9, + + /// <summary> + /// The chapter image. + /// </summary> + Chapter = 10, + + /// <summary> + /// The box rear. + /// </summary> + BoxRear = 11, + + /// <summary> + /// The user profile image. + /// </summary> + Profile = 12 +} diff --git a/Jellyfin.Data/Entities/ProgramAudioEntity.cs b/Jellyfin.Data/Entities/ProgramAudioEntity.cs new file mode 100644 index 000000000..fafccb13c --- /dev/null +++ b/Jellyfin.Data/Entities/ProgramAudioEntity.cs @@ -0,0 +1,37 @@ +namespace Jellyfin.Data.Entities; + +/// <summary> +/// Lists types of Audio. +/// </summary> +public enum ProgramAudioEntity +{ + /// <summary> + /// Mono. + /// </summary> + Mono, + + /// <summary> + /// Sterio. + /// </summary> + Stereo, + + /// <summary> + /// Dolby. + /// </summary> + Dolby, + + /// <summary> + /// DolbyDigital. + /// </summary> + DolbyDigital, + + /// <summary> + /// Thx. + /// </summary> + Thx, + + /// <summary> + /// Atmos. + /// </summary> + Atmos +} |
