diff options
| author | crobibero <cody@robibe.ro> | 2020-12-03 13:51:12 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-12-03 13:51:12 -0700 |
| commit | b0c79edd2c25f560208a40aedea05498d48ca80e (patch) | |
| tree | 4052b66cf1234c7d71bc122a96f93382e2eee566 /Jellyfin.Data | |
| parent | 4a3411cad17c95f3afe0870a1ff3a9afc10286fa (diff) | |
Add support for custom item display preferences
Diffstat (limited to 'Jellyfin.Data')
| -rw-r--r-- | Jellyfin.Data/Entities/CustomItemDisplayPreferences.cs | 80 |
1 files changed, 80 insertions, 0 deletions
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 +{ + /// <summary> + /// An entity that represents a user's custom display preferences for a specific item. + /// </summary> + public class CustomItemDisplayPreferences + { + /// <summary> + /// Initializes a new instance of the <see cref="CustomItemDisplayPreferences"/> class. + /// </summary> + /// <param name="userId">The user id.</param> + /// <param name="client">The client.</param> + /// <param name="preferenceKey">The preference key.</param> + /// <param name="preferenceValue">The preference value.</param> + public CustomItemDisplayPreferences(Guid userId, string client, string preferenceKey, string preferenceValue) + { + UserId = userId; + Client = client; + Key = preferenceKey; + Value = preferenceValue; + } + + /// <summary> + /// Initializes a new instance of the <see cref="CustomItemDisplayPreferences"/> class. + /// </summary> + protected CustomItemDisplayPreferences() + { + } + + /// <summary> + /// Gets or sets the Id. + /// </summary> + /// <remarks> + /// Required. + /// </remarks> + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; protected set; } + + /// <summary> + /// Gets or sets the user Id. + /// </summary> + /// <remarks> + /// Required. + /// </remarks> + public Guid UserId { get; set; } + + /// <summary> + /// Gets or sets the client string. + /// </summary> + /// <remarks> + /// Required. Max Length = 32. + /// </remarks> + [Required] + [MaxLength(32)] + [StringLength(32)] + public string Client { get; set; } + + /// <summary> + /// Gets or sets the preference key. + /// </summary> + /// <remarks> + /// Required. + /// </remarks> + [Required] + public string Key { get; set; } + + /// <summary> + /// Gets or sets the preference value. + /// </summary> + /// <remarks> + /// Required. + /// </remarks> + [Required] + public string Value { get; set; } + } +} |
