mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-23 15:30:56 -04:00
Make adjustments to display preference entities.
This commit is contained in:
parent
13d919f236
commit
592d2480ca
@ -14,14 +14,18 @@ namespace Jellyfin.Data.Entities
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="DisplayPreferences"/> class.
|
/// Initializes a new instance of the <see cref="DisplayPreferences"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="client">The client string.</param>
|
|
||||||
/// <param name="userId">The user's id.</param>
|
/// <param name="userId">The user's id.</param>
|
||||||
public DisplayPreferences(string client, Guid userId)
|
/// <param name="client">The client string.</param>
|
||||||
|
public DisplayPreferences(Guid userId, string client)
|
||||||
{
|
{
|
||||||
RememberIndexing = false;
|
|
||||||
ShowBackdrop = true;
|
|
||||||
Client = client;
|
|
||||||
UserId = userId;
|
UserId = userId;
|
||||||
|
Client = client;
|
||||||
|
ShowSidebar = false;
|
||||||
|
ShowBackdrop = true;
|
||||||
|
SkipForwardLength = 30000;
|
||||||
|
SkipBackwardLength = 10000;
|
||||||
|
ScrollDirection = ScrollDirection.Horizontal;
|
||||||
|
ChromecastVersion = ChromecastVersion.Stable;
|
||||||
|
|
||||||
HomeSections = new HashSet<HomeSection>();
|
HomeSections = new HashSet<HomeSection>();
|
||||||
}
|
}
|
||||||
@ -50,50 +54,17 @@ namespace Jellyfin.Data.Entities
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public Guid UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the id of the associated item.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This is currently unused. In the future, this will allow us to have users set
|
|
||||||
/// display preferences per item.
|
|
||||||
/// </remarks>
|
|
||||||
public Guid? ItemId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the client string.
|
/// Gets or sets the client string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Required. Max Length = 64.
|
/// Required. Max Length = 32.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[Required]
|
[Required]
|
||||||
[MaxLength(64)]
|
[MaxLength(32)]
|
||||||
[StringLength(64)]
|
[StringLength(32)]
|
||||||
public string Client { get; set; }
|
public string Client { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets a value indicating whether the indexing should be remembered.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Required.
|
|
||||||
/// </remarks>
|
|
||||||
public bool RememberIndexing { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets a value indicating whether the sorting type should be remembered.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Required.
|
|
||||||
/// </remarks>
|
|
||||||
public bool RememberSorting { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the sort order.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Required.
|
|
||||||
/// </remarks>
|
|
||||||
public SortOrder SortOrder { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether to show the sidebar.
|
/// Gets or sets a value indicating whether to show the sidebar.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -110,18 +81,6 @@ namespace Jellyfin.Data.Entities
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool ShowBackdrop { get; set; }
|
public bool ShowBackdrop { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets what the view should be sorted by.
|
|
||||||
/// </summary>
|
|
||||||
[MaxLength(64)]
|
|
||||||
[StringLength(64)]
|
|
||||||
public string SortBy { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the view type.
|
|
||||||
/// </summary>
|
|
||||||
public ViewType? ViewType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the scroll direction.
|
/// Gets or sets the scroll direction.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
120
Jellyfin.Data/Entities/LibraryDisplayPreferences.cs
Normal file
120
Jellyfin.Data/Entities/LibraryDisplayPreferences.cs
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
|
|
||||||
|
namespace Jellyfin.Data.Entities
|
||||||
|
{
|
||||||
|
public class LibraryDisplayPreferences
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LibraryDisplayPreferences"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId">The user id.</param>
|
||||||
|
/// <param name="itemId">The item id.</param>
|
||||||
|
/// <param name="client">The client.</param>
|
||||||
|
public LibraryDisplayPreferences(Guid userId, Guid itemId, string client)
|
||||||
|
{
|
||||||
|
UserId = userId;
|
||||||
|
ItemId = itemId;
|
||||||
|
Client = client;
|
||||||
|
|
||||||
|
SortBy = "SortName";
|
||||||
|
ViewType = ViewType.Poster;
|
||||||
|
SortOrder = SortOrder.Ascending;
|
||||||
|
RememberSorting = false;
|
||||||
|
RememberIndexing = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LibraryDisplayPreferences"/> class.
|
||||||
|
/// </summary>
|
||||||
|
protected LibraryDisplayPreferences()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Id.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Required.
|
||||||
|
/// </remarks>
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int Id { get; protected 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>
|
||||||
|
[Required]
|
||||||
|
[MaxLength(32)]
|
||||||
|
[StringLength(32)]
|
||||||
|
public string Client { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the view type.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Required.
|
||||||
|
/// </remarks>
|
||||||
|
public ViewType ViewType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the indexing should be remembered.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Required.
|
||||||
|
/// </remarks>
|
||||||
|
public bool RememberIndexing { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets what the view should be indexed by.
|
||||||
|
/// </summary>
|
||||||
|
public IndexingKind? IndexBy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the sorting type should be remembered.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Required.
|
||||||
|
/// </remarks>
|
||||||
|
public bool RememberSorting { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets what the view should be sorted by.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Required.
|
||||||
|
/// </remarks>
|
||||||
|
[Required]
|
||||||
|
[MaxLength(64)]
|
||||||
|
[StringLength(64)]
|
||||||
|
public string SortBy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the sort order.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Required.
|
||||||
|
/// </remarks>
|
||||||
|
public SortOrder SortOrder { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -48,6 +48,7 @@ namespace Jellyfin.Data.Entities
|
|||||||
PasswordResetProviderId = passwordResetProviderId;
|
PasswordResetProviderId = passwordResetProviderId;
|
||||||
|
|
||||||
AccessSchedules = new HashSet<AccessSchedule>();
|
AccessSchedules = new HashSet<AccessSchedule>();
|
||||||
|
LibraryDisplayPreferences = new HashSet<LibraryDisplayPreferences>();
|
||||||
// Groups = new HashSet<Group>();
|
// Groups = new HashSet<Group>();
|
||||||
Permissions = new HashSet<Permission>();
|
Permissions = new HashSet<Permission>();
|
||||||
Preferences = new HashSet<Preference>();
|
Preferences = new HashSet<Preference>();
|
||||||
@ -327,6 +328,15 @@ namespace Jellyfin.Data.Entities
|
|||||||
// [ForeignKey("UserId")]
|
// [ForeignKey("UserId")]
|
||||||
public virtual ImageInfo ProfileImage { get; set; }
|
public virtual ImageInfo ProfileImage { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the user's display preferences.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Required.
|
||||||
|
/// </remarks>
|
||||||
|
[Required]
|
||||||
|
public virtual DisplayPreferences DisplayPreferences { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public SyncPlayAccess SyncPlayAccess { get; set; }
|
public SyncPlayAccess SyncPlayAccess { get; set; }
|
||||||
|
|
||||||
@ -352,7 +362,7 @@ namespace Jellyfin.Data.Entities
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the list of item display preferences.
|
/// Gets or sets the list of item display preferences.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual ICollection<DisplayPreferences> DisplayPreferences { get; protected set; }
|
public virtual ICollection<LibraryDisplayPreferences> LibraryDisplayPreferences { get; protected set; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user