aboutsummaryrefslogtreecommitdiff
path: root/src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/DisplayPreferences.cs
blob: ae6966e594b4a1a2b52e3cde8d919327c765ef0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Enums;

namespace Jellyfin.Database.Implementations.Entities
{
    /// <summary>
    /// An entity representing a user's display preferences.
    /// </summary>
    public class DisplayPreferences
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DisplayPreferences"/> class.
        /// </summary>
        /// <param name="userId">The user's id.</param>
        /// <param name="itemId">The item id.</param>
        /// <param name="client">The client string.</param>
        public DisplayPreferences(Guid userId, Guid itemId, string client)
        {
            UserId = userId;
            ItemId = itemId;
            Client = client;
            ShowSidebar = false;
            ShowBackdrop = true;
            SkipForwardLength = 30000;
            SkipBackwardLength = 10000;
            ScrollDirection = ScrollDirection.Horizontal;
            ChromecastVersion = ChromecastVersion.Stable;

            HomeSections = new HashSet<HomeSection>();
        }

        /// <summary>
        /// Gets the Id.
        /// </summary>
        /// <remarks>
        /// Required.
        /// </remarks>
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; private set; }

        /// <summary>
        /// Gets or sets the user Id.
        /// </summary>
        /// <remarks>
        /// Required.
        /// </remarks>
        public Guid UserId { get; set; }

        /// <summary>
        /// Gets or sets the id of the associated item.
        /// </summary>
        /// <remarks>
        /// Required.
        /// </remarks>
        public Guid ItemId { get; set; }

        /// <summary>
        /// Gets or sets the client string.
        /// </summary>
        /// <remarks>
        /// Required. Max Length = 32.
        /// </remarks>
        [MaxLength(32)]
        [StringLength(32)]
        public string Client { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether to show the sidebar.
        /// </summary>
        /// <remarks>
        /// Required.
        /// </remarks>
        public bool ShowSidebar { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether to show the backdrop.
        /// </summary>
        /// <remarks>
        /// Required.
        /// </remarks>
        public bool ShowBackdrop { get; set; }

        /// <summary>
        /// Gets or sets the scroll direction.
        /// </summary>
        /// <remarks>
        /// Required.
        /// </remarks>
        public ScrollDirection ScrollDirection { get; set; }

        /// <summary>
        /// Gets or sets what the view should be indexed by.
        /// </summary>
        public IndexingKind? IndexBy { get; set; }

        /// <summary>
        /// Gets or sets the length of time to skip forwards, in milliseconds.
        /// </summary>
        /// <remarks>
        /// Required.
        /// </remarks>
        public int SkipForwardLength { get; set; }

        /// <summary>
        /// Gets or sets the length of time to skip backwards, in milliseconds.
        /// </summary>
        /// <remarks>
        /// Required.
        /// </remarks>
        public int SkipBackwardLength { get; set; }

        /// <summary>
        /// Gets or sets the Chromecast Version.
        /// </summary>
        /// <remarks>
        /// Required.
        /// </remarks>
        public ChromecastVersion ChromecastVersion { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the next video info overlay should be shown.
        /// </summary>
        /// <remarks>
        /// Required.
        /// </remarks>
        public bool EnableNextVideoInfoOverlay { get; set; }

        /// <summary>
        /// Gets or sets the dashboard theme.
        /// </summary>
        [MaxLength(32)]
        [StringLength(32)]
        public string? DashboardTheme { get; set; }

        /// <summary>
        /// Gets or sets the tv home screen.
        /// </summary>
        [MaxLength(32)]
        [StringLength(32)]
        public string? TvHome { get; set; }

        /// <summary>
        /// Gets the home sections.
        /// </summary>
        public virtual ICollection<HomeSection> HomeSections { get; private set; }
    }
}