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 client string. /// The user's id. public DisplayPreferences(string client, Guid userId) { RememberIndexing = false; ShowBackdrop = true; Client = client; UserId = userId; HomeSections = new HashSet(); } /// /// Initializes a new instance of the class. /// protected DisplayPreferences() { } /// /// Gets or sets the Id. /// /// /// Required. /// [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; protected set; } /// /// Gets or sets the user Id. /// /// /// Required. /// public Guid UserId { get; set; } /// /// Gets or sets the id of the associated item. /// /// /// This is currently unused. In the future, this will allow us to have users set /// display preferences per item. /// public Guid? ItemId { get; set; } /// /// Gets or sets the client string. /// /// /// Required. Max Length = 64. /// [Required] [MaxLength(64)] [StringLength(64)] public string Client { get; set; } /// /// Gets or sets a value indicating whether the indexing should be remembered. /// /// /// Required. /// public bool RememberIndexing { get; set; } /// /// Gets or sets a value indicating whether the sorting type should be remembered. /// /// /// Required. /// public bool RememberSorting { get; set; } /// /// Gets or sets the sort order. /// /// /// Required. /// public SortOrder SortOrder { 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 what the view should be sorted by. /// [MaxLength(64)] [StringLength(64)] public string SortBy { get; set; } /// /// Gets or sets the view type. /// public ViewType? ViewType { 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 home sections. /// public virtual ICollection HomeSections { get; protected set; } } }