| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using System.ComponentModel.DataAnnotations; |
| | 4 | | using System.ComponentModel.DataAnnotations.Schema; |
| | 5 | | using Jellyfin.Database.Implementations.Enums; |
| | 6 | |
|
| | 7 | | namespace Jellyfin.Database.Implementations.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 | | { |
| 0 | 22 | | UserId = userId; |
| 0 | 23 | | ItemId = itemId; |
| 0 | 24 | | Client = client; |
| 0 | 25 | | ShowSidebar = false; |
| 0 | 26 | | ShowBackdrop = true; |
| 0 | 27 | | SkipForwardLength = 30000; |
| 0 | 28 | | SkipBackwardLength = 10000; |
| 0 | 29 | | ScrollDirection = ScrollDirection.Horizontal; |
| 0 | 30 | | ChromecastVersion = ChromecastVersion.Stable; |
| | 31 | |
|
| 0 | 32 | | HomeSections = new HashSet<HomeSection>(); |
| 0 | 33 | | } |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// Gets the Id. |
| | 37 | | /// </summary> |
| | 38 | | /// <remarks> |
| | 39 | | /// Required. |
| | 40 | | /// </remarks> |
| | 41 | | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
| | 42 | | public int Id { get; private set; } |
| | 43 | |
|
| | 44 | | /// <summary> |
| | 45 | | /// Gets or sets the user Id. |
| | 46 | | /// </summary> |
| | 47 | | /// <remarks> |
| | 48 | | /// Required. |
| | 49 | | /// </remarks> |
| | 50 | | public Guid UserId { get; set; } |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// Gets or sets the id of the associated item. |
| | 54 | | /// </summary> |
| | 55 | | /// <remarks> |
| | 56 | | /// Required. |
| | 57 | | /// </remarks> |
| | 58 | | public Guid ItemId { get; set; } |
| | 59 | |
|
| | 60 | | /// <summary> |
| | 61 | | /// Gets or sets the client string. |
| | 62 | | /// </summary> |
| | 63 | | /// <remarks> |
| | 64 | | /// Required. Max Length = 32. |
| | 65 | | /// </remarks> |
| | 66 | | [MaxLength(32)] |
| | 67 | | [StringLength(32)] |
| | 68 | | public string Client { get; set; } |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Gets or sets a value indicating whether to show the sidebar. |
| | 72 | | /// </summary> |
| | 73 | | /// <remarks> |
| | 74 | | /// Required. |
| | 75 | | /// </remarks> |
| | 76 | | public bool ShowSidebar { get; set; } |
| | 77 | |
|
| | 78 | | /// <summary> |
| | 79 | | /// Gets or sets a value indicating whether to show the backdrop. |
| | 80 | | /// </summary> |
| | 81 | | /// <remarks> |
| | 82 | | /// Required. |
| | 83 | | /// </remarks> |
| | 84 | | public bool ShowBackdrop { get; set; } |
| | 85 | |
|
| | 86 | | /// <summary> |
| | 87 | | /// Gets or sets the scroll direction. |
| | 88 | | /// </summary> |
| | 89 | | /// <remarks> |
| | 90 | | /// Required. |
| | 91 | | /// </remarks> |
| | 92 | | public ScrollDirection ScrollDirection { get; set; } |
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// Gets or sets what the view should be indexed by. |
| | 96 | | /// </summary> |
| | 97 | | public IndexingKind? IndexBy { get; set; } |
| | 98 | |
|
| | 99 | | /// <summary> |
| | 100 | | /// Gets or sets the length of time to skip forwards, in milliseconds. |
| | 101 | | /// </summary> |
| | 102 | | /// <remarks> |
| | 103 | | /// Required. |
| | 104 | | /// </remarks> |
| | 105 | | public int SkipForwardLength { get; set; } |
| | 106 | |
|
| | 107 | | /// <summary> |
| | 108 | | /// Gets or sets the length of time to skip backwards, in milliseconds. |
| | 109 | | /// </summary> |
| | 110 | | /// <remarks> |
| | 111 | | /// Required. |
| | 112 | | /// </remarks> |
| | 113 | | public int SkipBackwardLength { get; set; } |
| | 114 | |
|
| | 115 | | /// <summary> |
| | 116 | | /// Gets or sets the Chromecast Version. |
| | 117 | | /// </summary> |
| | 118 | | /// <remarks> |
| | 119 | | /// Required. |
| | 120 | | /// </remarks> |
| | 121 | | public ChromecastVersion ChromecastVersion { get; set; } |
| | 122 | |
|
| | 123 | | /// <summary> |
| | 124 | | /// Gets or sets a value indicating whether the next video info overlay should be shown. |
| | 125 | | /// </summary> |
| | 126 | | /// <remarks> |
| | 127 | | /// Required. |
| | 128 | | /// </remarks> |
| | 129 | | public bool EnableNextVideoInfoOverlay { get; set; } |
| | 130 | |
|
| | 131 | | /// <summary> |
| | 132 | | /// Gets or sets the dashboard theme. |
| | 133 | | /// </summary> |
| | 134 | | [MaxLength(32)] |
| | 135 | | [StringLength(32)] |
| | 136 | | public string? DashboardTheme { get; set; } |
| | 137 | |
|
| | 138 | | /// <summary> |
| | 139 | | /// Gets or sets the tv home screen. |
| | 140 | | /// </summary> |
| | 141 | | [MaxLength(32)] |
| | 142 | | [StringLength(32)] |
| | 143 | | public string? TvHome { get; set; } |
| | 144 | |
|
| | 145 | | /// <summary> |
| | 146 | | /// Gets the home sections. |
| | 147 | | /// </summary> |
| | 148 | | public virtual ICollection<HomeSection> HomeSections { get; private set; } |
| | 149 | | } |
| | 150 | | } |