From b0c79edd2c25f560208a40aedea05498d48ca80e Mon Sep 17 00:00:00 2001 From: crobibero Date: Thu, 3 Dec 2020 13:51:12 -0700 Subject: Add support for custom item display preferences --- .../Entities/CustomItemDisplayPreferences.cs | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Jellyfin.Data/Entities/CustomItemDisplayPreferences.cs (limited to 'Jellyfin.Data/Entities') diff --git a/Jellyfin.Data/Entities/CustomItemDisplayPreferences.cs b/Jellyfin.Data/Entities/CustomItemDisplayPreferences.cs new file mode 100644 index 0000000000..452d933eba --- /dev/null +++ b/Jellyfin.Data/Entities/CustomItemDisplayPreferences.cs @@ -0,0 +1,80 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Jellyfin.Data.Entities +{ + /// + /// An entity that represents a user's custom display preferences for a specific item. + /// + public class CustomItemDisplayPreferences + { + /// + /// Initializes a new instance of the class. + /// + /// The user id. + /// The client. + /// The preference key. + /// The preference value. + public CustomItemDisplayPreferences(Guid userId, string client, string preferenceKey, string preferenceValue) + { + UserId = userId; + Client = client; + Key = preferenceKey; + Value = preferenceValue; + } + + /// + /// Initializes a new instance of the class. + /// + protected CustomItemDisplayPreferences() + { + } + + /// + /// Gets or sets the Id. + /// + /// + /// Required. + /// + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; protected set; } + + /// + /// Gets or sets the user Id. + /// + /// + /// Required. + /// + public Guid UserId { get; set; } + + /// + /// Gets or sets the client string. + /// + /// + /// Required. Max Length = 32. + /// + [Required] + [MaxLength(32)] + [StringLength(32)] + public string Client { get; set; } + + /// + /// Gets or sets the preference key. + /// + /// + /// Required. + /// + [Required] + public string Key { get; set; } + + /// + /// Gets or sets the preference value. + /// + /// + /// Required. + /// + [Required] + public string Value { get; set; } + } +} -- cgit v1.2.3