2020-09-01 08:36:45 -07:00
|
|
|
|
#pragma warning disable CA2227
|
|
|
|
|
|
|
|
|
|
using System;
|
2020-06-30 18:44:41 -07:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
using Jellyfin.Data.Enums;
|
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Data.Entities
|
|
|
|
|
{
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// An entity representing a user's display preferences.
|
|
|
|
|
/// </summary>
|
2020-06-30 18:44:41 -07:00
|
|
|
|
public class DisplayPreferences
|
|
|
|
|
{
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of the <see cref="DisplayPreferences"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">The user's id.</param>
|
2020-07-27 16:22:34 -07:00
|
|
|
|
/// <param name="client">The client string.</param>
|
|
|
|
|
public DisplayPreferences(Guid userId, string client)
|
2020-06-30 18:44:41 -07:00
|
|
|
|
{
|
|
|
|
|
UserId = userId;
|
2020-07-27 16:22:34 -07:00
|
|
|
|
Client = client;
|
|
|
|
|
ShowSidebar = false;
|
|
|
|
|
ShowBackdrop = true;
|
|
|
|
|
SkipForwardLength = 30000;
|
|
|
|
|
SkipBackwardLength = 10000;
|
|
|
|
|
ScrollDirection = ScrollDirection.Horizontal;
|
|
|
|
|
ChromecastVersion = ChromecastVersion.Stable;
|
2020-07-27 17:44:46 -07:00
|
|
|
|
DashboardTheme = string.Empty;
|
2020-07-27 17:50:58 -07:00
|
|
|
|
TvHome = string.Empty;
|
2020-06-30 18:44:41 -07:00
|
|
|
|
|
|
|
|
|
HomeSections = new HashSet<HomeSection>();
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of the <see cref="DisplayPreferences"/> class.
|
|
|
|
|
/// </summary>
|
2020-06-30 18:44:41 -07:00
|
|
|
|
protected DisplayPreferences()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the Id.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
2020-06-30 18:44:41 -07:00
|
|
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
|
|
|
public int Id { get; protected set; }
|
|
|
|
|
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the user Id.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
2020-06-30 18:44:41 -07:00
|
|
|
|
public Guid UserId { get; set; }
|
|
|
|
|
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the client string.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
2020-07-27 16:22:34 -07:00
|
|
|
|
/// Required. Max Length = 32.
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// </remarks>
|
2020-06-30 18:44:41 -07:00
|
|
|
|
[Required]
|
2020-07-27 16:22:34 -07:00
|
|
|
|
[MaxLength(32)]
|
|
|
|
|
[StringLength(32)]
|
2020-06-30 18:44:41 -07:00
|
|
|
|
public string Client { get; set; }
|
|
|
|
|
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether to show the sidebar.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
2020-06-30 18:44:41 -07:00
|
|
|
|
public bool ShowSidebar { get; set; }
|
|
|
|
|
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether to show the backdrop.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
2020-06-30 18:44:41 -07:00
|
|
|
|
public bool ShowBackdrop { get; set; }
|
|
|
|
|
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the scroll direction.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
2020-06-30 18:44:41 -07:00
|
|
|
|
public ScrollDirection ScrollDirection { get; set; }
|
|
|
|
|
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets what the view should be indexed by.
|
|
|
|
|
/// </summary>
|
2020-06-30 18:44:41 -07:00
|
|
|
|
public IndexingKind? IndexBy { get; set; }
|
|
|
|
|
|
2020-07-17 16:36:55 -07:00
|
|
|
|
/// <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; }
|
|
|
|
|
|
2020-07-27 17:44:46 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the dashboard theme.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(32)]
|
|
|
|
|
[StringLength(32)]
|
|
|
|
|
public string DashboardTheme { get; set; }
|
|
|
|
|
|
2020-07-27 17:50:58 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the tv home screen.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(32)]
|
|
|
|
|
[StringLength(32)]
|
|
|
|
|
public string TvHome { get; set; }
|
|
|
|
|
|
2020-07-09 19:00:34 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the home sections.
|
|
|
|
|
/// </summary>
|
2020-06-30 18:44:41 -07:00
|
|
|
|
public virtual ICollection<HomeSection> HomeSections { get; protected set; }
|
|
|
|
|
}
|
|
|
|
|
}
|