CustomItemDisplayPreferences.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. namespace Jellyfin.Data.Entities
  5. {
  6. /// <summary>
  7. /// An entity that represents a user's custom display preferences for a specific item.
  8. /// </summary>
  9. public class CustomItemDisplayPreferences
  10. {
  11. /// <summary>
  12. /// Initializes a new instance of the <see cref="CustomItemDisplayPreferences"/> class.
  13. /// </summary>
  14. /// <param name="userId">The user id.</param>
  15. /// <param name="itemId">The item id.</param>
  16. /// <param name="client">The client.</param>
  17. /// <param name="preferenceKey">The preference key.</param>
  18. /// <param name="preferenceValue">The preference value.</param>
  19. public CustomItemDisplayPreferences(Guid userId, Guid itemId, string client, string preferenceKey, string preferenceValue)
  20. {
  21. UserId = userId;
  22. ItemId = itemId;
  23. Client = client;
  24. Key = preferenceKey;
  25. Value = preferenceValue;
  26. }
  27. /// <summary>
  28. /// Initializes a new instance of the <see cref="CustomItemDisplayPreferences"/> class.
  29. /// </summary>
  30. protected CustomItemDisplayPreferences()
  31. {
  32. }
  33. /// <summary>
  34. /// Gets or sets the Id.
  35. /// </summary>
  36. /// <remarks>
  37. /// Required.
  38. /// </remarks>
  39. [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  40. public int Id { get; protected set; }
  41. /// <summary>
  42. /// Gets or sets the user Id.
  43. /// </summary>
  44. /// <remarks>
  45. /// Required.
  46. /// </remarks>
  47. public Guid UserId { get; set; }
  48. /// <summary>
  49. /// Gets or sets the id of the associated item.
  50. /// </summary>
  51. /// <remarks>
  52. /// Required.
  53. /// </remarks>
  54. public Guid ItemId { get; set; }
  55. /// <summary>
  56. /// Gets or sets the client string.
  57. /// </summary>
  58. /// <remarks>
  59. /// Required. Max Length = 32.
  60. /// </remarks>
  61. [Required]
  62. [MaxLength(32)]
  63. [StringLength(32)]
  64. public string Client { get; set; }
  65. /// <summary>
  66. /// Gets or sets the preference key.
  67. /// </summary>
  68. /// <remarks>
  69. /// Required.
  70. /// </remarks>
  71. [Required]
  72. public string Key { get; set; }
  73. /// <summary>
  74. /// Gets or sets the preference value.
  75. /// </summary>
  76. /// <remarks>
  77. /// Required.
  78. /// </remarks>
  79. [Required]
  80. public string Value { get; set; }
  81. }
  82. }