2020-12-03 20:51:12 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Data.Entities
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// An entity that represents a user's custom display preferences for a specific item.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class CustomItemDisplayPreferences
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of the <see cref="CustomItemDisplayPreferences"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">The user id.</param>
|
2020-12-04 23:00:11 +00:00
|
|
|
|
/// <param name="itemId">The item id.</param>
|
2020-12-03 20:51:12 +00:00
|
|
|
|
/// <param name="client">The client.</param>
|
2021-03-06 21:17:19 +00:00
|
|
|
|
/// <param name="key">The preference key.</param>
|
|
|
|
|
/// <param name="value">The preference value.</param>
|
2021-04-07 11:09:00 +00:00
|
|
|
|
public CustomItemDisplayPreferences(Guid userId, Guid itemId, string client, string key, string? value)
|
2020-12-03 20:51:12 +00:00
|
|
|
|
{
|
|
|
|
|
UserId = userId;
|
2020-12-04 23:00:11 +00:00
|
|
|
|
ItemId = itemId;
|
2020-12-03 20:51:12 +00:00
|
|
|
|
Client = client;
|
2021-03-06 21:17:19 +00:00
|
|
|
|
Key = key;
|
|
|
|
|
Value = value;
|
2020-12-03 20:51:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-03-17 23:08:11 +00:00
|
|
|
|
/// Gets the Id.
|
2020-12-03 20:51:12 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
2021-03-17 23:08:11 +00:00
|
|
|
|
public int Id { get; private set; }
|
2020-12-03 20:51:12 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the user Id.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
public Guid UserId { get; set; }
|
|
|
|
|
|
2020-12-04 23:00:11 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the id of the associated item.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
public Guid ItemId { get; set; }
|
|
|
|
|
|
2020-12-03 20:51:12 +00:00
|
|
|
|
/// <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 the preference key.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
public string Key { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the preference value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
2021-04-07 11:09:00 +00:00
|
|
|
|
public string? Value { get; set; }
|
2020-12-03 20:51:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|