| | | 1 | | using System; |
| | | 2 | | using System.ComponentModel.DataAnnotations; |
| | | 3 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 4 | | |
| | | 5 | | namespace Jellyfin.Database.Implementations.Entities |
| | | 6 | | { |
| | | 7 | | /// <summary> |
| | | 8 | | /// An entity that represents a user's custom display preferences for a specific item. |
| | | 9 | | /// </summary> |
| | | 10 | | public class CustomItemDisplayPreferences |
| | | 11 | | { |
| | | 12 | | /// <summary> |
| | | 13 | | /// Initializes a new instance of the <see cref="CustomItemDisplayPreferences"/> class. |
| | | 14 | | /// </summary> |
| | | 15 | | /// <param name="userId">The user id.</param> |
| | | 16 | | /// <param name="itemId">The item id.</param> |
| | | 17 | | /// <param name="client">The client.</param> |
| | | 18 | | /// <param name="key">The preference key.</param> |
| | | 19 | | /// <param name="value">The preference value.</param> |
| | | 20 | | public CustomItemDisplayPreferences(Guid userId, Guid itemId, string client, string key, string? value) |
| | | 21 | | { |
| | 0 | 22 | | UserId = userId; |
| | 0 | 23 | | ItemId = itemId; |
| | 0 | 24 | | Client = client; |
| | 0 | 25 | | Key = key; |
| | 0 | 26 | | Value = value; |
| | 0 | 27 | | } |
| | | 28 | | |
| | | 29 | | /// <summary> |
| | | 30 | | /// Gets the Id. |
| | | 31 | | /// </summary> |
| | | 32 | | /// <remarks> |
| | | 33 | | /// Required. |
| | | 34 | | /// </remarks> |
| | | 35 | | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
| | | 36 | | public int Id { get; private set; } |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// Gets or sets the user Id. |
| | | 40 | | /// </summary> |
| | | 41 | | /// <remarks> |
| | | 42 | | /// Required. |
| | | 43 | | /// </remarks> |
| | | 44 | | public Guid UserId { get; set; } |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// Gets or sets the id of the associated item. |
| | | 48 | | /// </summary> |
| | | 49 | | /// <remarks> |
| | | 50 | | /// Required. |
| | | 51 | | /// </remarks> |
| | | 52 | | public Guid ItemId { get; set; } |
| | | 53 | | |
| | | 54 | | /// <summary> |
| | | 55 | | /// Gets or sets the client string. |
| | | 56 | | /// </summary> |
| | | 57 | | /// <remarks> |
| | | 58 | | /// Required. Max Length = 32. |
| | | 59 | | /// </remarks> |
| | | 60 | | [MaxLength(32)] |
| | | 61 | | [StringLength(32)] |
| | | 62 | | public string Client { get; set; } |
| | | 63 | | |
| | | 64 | | /// <summary> |
| | | 65 | | /// Gets or sets the preference key. |
| | | 66 | | /// </summary> |
| | | 67 | | /// <remarks> |
| | | 68 | | /// Required. |
| | | 69 | | /// </remarks> |
| | | 70 | | public string Key { get; set; } |
| | | 71 | | |
| | | 72 | | /// <summary> |
| | | 73 | | /// Gets or sets the preference value. |
| | | 74 | | /// </summary> |
| | | 75 | | /// <remarks> |
| | | 76 | | /// Required. |
| | | 77 | | /// </remarks> |
| | | 78 | | public string? Value { get; set; } |
| | | 79 | | } |
| | | 80 | | } |