CustomItemDisplayPreferences.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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="key">The preference key.</param>
  18. /// <param name="value">The preference value.</param>
  19. public CustomItemDisplayPreferences(Guid userId, Guid itemId, string client, string key, string? value)
  20. {
  21. UserId = userId;
  22. ItemId = itemId;
  23. Client = client;
  24. Key = key;
  25. Value = value;
  26. }
  27. /// <summary>
  28. /// Gets the Id.
  29. /// </summary>
  30. /// <remarks>
  31. /// Required.
  32. /// </remarks>
  33. [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  34. public int Id { get; private set; }
  35. /// <summary>
  36. /// Gets or sets the user Id.
  37. /// </summary>
  38. /// <remarks>
  39. /// Required.
  40. /// </remarks>
  41. public Guid UserId { get; set; }
  42. /// <summary>
  43. /// Gets or sets the id of the associated item.
  44. /// </summary>
  45. /// <remarks>
  46. /// Required.
  47. /// </remarks>
  48. public Guid ItemId { get; set; }
  49. /// <summary>
  50. /// Gets or sets the client string.
  51. /// </summary>
  52. /// <remarks>
  53. /// Required. Max Length = 32.
  54. /// </remarks>
  55. [MaxLength(32)]
  56. [StringLength(32)]
  57. public string Client { get; set; }
  58. /// <summary>
  59. /// Gets or sets the preference key.
  60. /// </summary>
  61. /// <remarks>
  62. /// Required.
  63. /// </remarks>
  64. public string Key { get; set; }
  65. /// <summary>
  66. /// Gets or sets the preference value.
  67. /// </summary>
  68. /// <remarks>
  69. /// Required.
  70. /// </remarks>
  71. public string? Value { get; set; }
  72. }
  73. }