DisplayPreferences.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. #pragma warning disable CA2227
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.ComponentModel.DataAnnotations.Schema;
  6. using Jellyfin.Data.Enums;
  7. namespace Jellyfin.Data.Entities
  8. {
  9. /// <summary>
  10. /// An entity representing a user's display preferences.
  11. /// </summary>
  12. public class DisplayPreferences
  13. {
  14. /// <summary>
  15. /// Initializes a new instance of the <see cref="DisplayPreferences"/> class.
  16. /// </summary>
  17. /// <param name="userId">The user's id.</param>
  18. /// <param name="itemId">The item id.</param>
  19. /// <param name="client">The client string.</param>
  20. public DisplayPreferences(Guid userId, Guid itemId, string client)
  21. {
  22. UserId = userId;
  23. ItemId = itemId;
  24. Client = client;
  25. ShowSidebar = false;
  26. ShowBackdrop = true;
  27. SkipForwardLength = 30000;
  28. SkipBackwardLength = 10000;
  29. ScrollDirection = ScrollDirection.Horizontal;
  30. ChromecastVersion = ChromecastVersion.Stable;
  31. HomeSections = new HashSet<HomeSection>();
  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. [MaxLength(32)]
  62. [StringLength(32)]
  63. public string Client { get; set; }
  64. /// <summary>
  65. /// Gets or sets a value indicating whether to show the sidebar.
  66. /// </summary>
  67. /// <remarks>
  68. /// Required.
  69. /// </remarks>
  70. public bool ShowSidebar { get; set; }
  71. /// <summary>
  72. /// Gets or sets a value indicating whether to show the backdrop.
  73. /// </summary>
  74. /// <remarks>
  75. /// Required.
  76. /// </remarks>
  77. public bool ShowBackdrop { get; set; }
  78. /// <summary>
  79. /// Gets or sets the scroll direction.
  80. /// </summary>
  81. /// <remarks>
  82. /// Required.
  83. /// </remarks>
  84. public ScrollDirection ScrollDirection { get; set; }
  85. /// <summary>
  86. /// Gets or sets what the view should be indexed by.
  87. /// </summary>
  88. public IndexingKind? IndexBy { get; set; }
  89. /// <summary>
  90. /// Gets or sets the length of time to skip forwards, in milliseconds.
  91. /// </summary>
  92. /// <remarks>
  93. /// Required.
  94. /// </remarks>
  95. public int SkipForwardLength { get; set; }
  96. /// <summary>
  97. /// Gets or sets the length of time to skip backwards, in milliseconds.
  98. /// </summary>
  99. /// <remarks>
  100. /// Required.
  101. /// </remarks>
  102. public int SkipBackwardLength { get; set; }
  103. /// <summary>
  104. /// Gets or sets the Chromecast Version.
  105. /// </summary>
  106. /// <remarks>
  107. /// Required.
  108. /// </remarks>
  109. public ChromecastVersion ChromecastVersion { get; set; }
  110. /// <summary>
  111. /// Gets or sets a value indicating whether the next video info overlay should be shown.
  112. /// </summary>
  113. /// <remarks>
  114. /// Required.
  115. /// </remarks>
  116. public bool EnableNextVideoInfoOverlay { get; set; }
  117. /// <summary>
  118. /// Gets or sets the dashboard theme.
  119. /// </summary>
  120. [MaxLength(32)]
  121. [StringLength(32)]
  122. public string? DashboardTheme { get; set; }
  123. /// <summary>
  124. /// Gets or sets the tv home screen.
  125. /// </summary>
  126. [MaxLength(32)]
  127. [StringLength(32)]
  128. public string? TvHome { get; set; }
  129. /// <summary>
  130. /// Gets or sets the home sections.
  131. /// </summary>
  132. public virtual ICollection<HomeSection> HomeSections { get; protected set; }
  133. }
  134. }