using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Jellyfin.Data.Enums; namespace Jellyfin.Data.Entities { /// /// An entity representing a user's display preferences. /// public class DisplayPreferences { /// /// Initializes a new instance of the class. /// /// The user's id. /// The item id. /// The client string. 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(); } /// /// Gets the Id. /// /// /// Required. /// [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; private set; } /// /// Gets or sets the user Id. /// /// /// Required. /// public Guid UserId { get; set; } /// /// Gets or sets the id of the associated item. /// /// /// Required. /// public Guid ItemId { get; set; } /// /// Gets or sets the client string. /// /// /// Required. Max Length = 32. /// [MaxLength(32)] [StringLength(32)] public string Client { get; set; } /// /// Gets or sets a value indicating whether to show the sidebar. /// /// /// Required. /// public bool ShowSidebar { get; set; } /// /// Gets or sets a value indicating whether to show the backdrop. /// /// /// Required. /// public bool ShowBackdrop { get; set; } /// /// Gets or sets the scroll direction. /// /// /// Required. /// public ScrollDirection ScrollDirection { get; set; } /// /// Gets or sets what the view should be indexed by. /// public IndexingKind? IndexBy { get; set; } /// /// Gets or sets the length of time to skip forwards, in milliseconds. /// /// /// Required. /// public int SkipForwardLength { get; set; } /// /// Gets or sets the length of time to skip backwards, in milliseconds. /// /// /// Required. /// public int SkipBackwardLength { get; set; } /// /// Gets or sets the Chromecast Version. /// /// /// Required. /// public ChromecastVersion ChromecastVersion { get; set; } /// /// Gets or sets a value indicating whether the next video info overlay should be shown. /// /// /// Required. /// public bool EnableNextVideoInfoOverlay { get; set; } /// /// Gets or sets the dashboard theme. /// [MaxLength(32)] [StringLength(32)] public string? DashboardTheme { get; set; } /// /// Gets or sets the tv home screen. /// [MaxLength(32)] [StringLength(32)] public string? TvHome { get; set; } /// /// Gets the home sections. /// public virtual ICollection HomeSections { get; private set; } } }