From eb601e944cd392a8007b540ab5627977a37368c6 Mon Sep 17 00:00:00 2001 From: JPVenson Date: Wed, 9 Oct 2024 23:01:54 +0000 Subject: Expanded BaseItem aggregate types --- Jellyfin.Data/Entities/ProgramAudioEntity.cs | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Jellyfin.Data/Entities/ProgramAudioEntity.cs (limited to 'Jellyfin.Data/Entities/ProgramAudioEntity.cs') 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; + +/// +/// Lists types of Audio. +/// +public enum ProgramAudioEntity +{ + /// + /// Mono. + /// + Mono, + + /// + /// Sterio. + /// + Stereo, + + /// + /// Dolby. + /// + Dolby, + + /// + /// DolbyDigital. + /// + DolbyDigital, + + /// + /// Thx. + /// + Thx, + + /// + /// Atmos. + /// + Atmos +} -- cgit v1.2.3 From 441b99518988212a84070dffe1ef51d6faa4e0af Mon Sep 17 00:00:00 2001 From: JPVenson Date: Thu, 10 Oct 2024 15:27:13 +0000 Subject: Applied Review Suggestions --- Emby.Server.Implementations/Data/ItemTypeLookup.cs | 3 ++- Jellyfin.Data/Entities/BaseItemMetadataField.cs | 2 -- Jellyfin.Data/Entities/BaseItemTrailerType.cs | 3 +-- Jellyfin.Data/Entities/EnumLikeTable.cs | 14 -------------- Jellyfin.Data/Entities/MediaStreamTypeEntity.cs | 12 ++++++------ Jellyfin.Data/Entities/ProgramAudioEntity.cs | 12 ++++++------ 6 files changed, 15 insertions(+), 31 deletions(-) delete mode 100644 Jellyfin.Data/Entities/EnumLikeTable.cs (limited to 'Jellyfin.Data/Entities/ProgramAudioEntity.cs') diff --git a/Emby.Server.Implementations/Data/ItemTypeLookup.cs b/Emby.Server.Implementations/Data/ItemTypeLookup.cs index b66e7f5d9..df0f4ea20 100644 --- a/Emby.Server.Implementations/Data/ItemTypeLookup.cs +++ b/Emby.Server.Implementations/Data/ItemTypeLookup.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Frozen; using System.Collections.Generic; using System.Threading.Channels; using Emby.Server.Implementations.Playlists; @@ -116,5 +117,5 @@ public class ItemTypeLookup : IItemTypeLookup { BaseItemKind.UserView, typeof(UserView).FullName }, { BaseItemKind.Video, typeof(Video).FullName }, { BaseItemKind.Year, typeof(Year).FullName } - }.AsReadOnly(); + }.ToFrozenDictionary(); } diff --git a/Jellyfin.Data/Entities/BaseItemMetadataField.cs b/Jellyfin.Data/Entities/BaseItemMetadataField.cs index 2f8e910f2..c9d44c046 100644 --- a/Jellyfin.Data/Entities/BaseItemMetadataField.cs +++ b/Jellyfin.Data/Entities/BaseItemMetadataField.cs @@ -1,8 +1,6 @@ using System; -using System.Collections.Generic; namespace Jellyfin.Data.Entities; -#pragma warning disable CA2227 /// /// Enum MetadataFields. diff --git a/Jellyfin.Data/Entities/BaseItemTrailerType.cs b/Jellyfin.Data/Entities/BaseItemTrailerType.cs index 7dee20c87..fb31fc8a4 100644 --- a/Jellyfin.Data/Entities/BaseItemTrailerType.cs +++ b/Jellyfin.Data/Entities/BaseItemTrailerType.cs @@ -1,8 +1,7 @@ using System; -using System.Collections.Generic; namespace Jellyfin.Data.Entities; -#pragma warning disable CA2227 + /// /// Enum TrailerTypes. /// diff --git a/Jellyfin.Data/Entities/EnumLikeTable.cs b/Jellyfin.Data/Entities/EnumLikeTable.cs deleted file mode 100644 index 11e1d0aa9..000000000 --- a/Jellyfin.Data/Entities/EnumLikeTable.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; - -namespace Jellyfin.Data.Entities; - -/// -/// Defines an Entity that is modeled after an Enum. -/// -public abstract class EnumLikeTable -{ - /// - /// Gets or Sets Numerical ID of this enumeratable. - /// - public required int Id { get; set; } -} diff --git a/Jellyfin.Data/Entities/MediaStreamTypeEntity.cs b/Jellyfin.Data/Entities/MediaStreamTypeEntity.cs index d1f6f1b18..f57672a2c 100644 --- a/Jellyfin.Data/Entities/MediaStreamTypeEntity.cs +++ b/Jellyfin.Data/Entities/MediaStreamTypeEntity.cs @@ -8,30 +8,30 @@ public enum MediaStreamTypeEntity /// /// The audio. /// - Audio, + Audio = 0, /// /// The video. /// - Video, + Video = 1, /// /// The subtitle. /// - Subtitle, + Subtitle = 2, /// /// The embedded image. /// - EmbeddedImage, + EmbeddedImage = 3, /// /// The data. /// - Data, + Data = 4, /// /// The lyric. /// - Lyric + Lyric = 5 } diff --git a/Jellyfin.Data/Entities/ProgramAudioEntity.cs b/Jellyfin.Data/Entities/ProgramAudioEntity.cs index fafccb13c..5b225a002 100644 --- a/Jellyfin.Data/Entities/ProgramAudioEntity.cs +++ b/Jellyfin.Data/Entities/ProgramAudioEntity.cs @@ -8,30 +8,30 @@ public enum ProgramAudioEntity /// /// Mono. /// - Mono, + Mono = 0, /// /// Sterio. /// - Stereo, + Stereo = 1, /// /// Dolby. /// - Dolby, + Dolby = 2, /// /// DolbyDigital. /// - DolbyDigital, + DolbyDigital = 3, /// /// Thx. /// - Thx, + Thx = 4, /// /// Atmos. /// - Atmos + Atmos = 5 } -- cgit v1.2.3