< Summary - Jellyfin

Information
Class: Jellyfin.Data.Entities.ItemDisplayPreferences
Assembly: Jellyfin.Data
File(s): /srv/git/jellyfin/Jellyfin.Data/Entities/ItemDisplayPreferences.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 113
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%

File(s)

/srv/git/jellyfin/Jellyfin.Data/Entities/ItemDisplayPreferences.cs

#LineLine coverage
 1using System;
 2using System.ComponentModel.DataAnnotations;
 3using System.ComponentModel.DataAnnotations.Schema;
 4using Jellyfin.Data.Enums;
 5
 6namespace Jellyfin.Data.Entities
 7{
 8    /// <summary>
 9    /// An entity that represents a user's display preferences for a specific item.
 10    /// </summary>
 11    public class ItemDisplayPreferences
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of the <see cref="ItemDisplayPreferences"/> class.
 15        /// </summary>
 16        /// <param name="userId">The user id.</param>
 17        /// <param name="itemId">The item id.</param>
 18        /// <param name="client">The client.</param>
 19        public ItemDisplayPreferences(Guid userId, Guid itemId, string client)
 20        {
 021            UserId = userId;
 022            ItemId = itemId;
 023            Client = client;
 24
 025            SortBy = "SortName";
 026            SortOrder = SortOrder.Ascending;
 027            RememberSorting = false;
 028            RememberIndexing = false;
 029        }
 30
 31        /// <summary>
 32        /// Gets the id.
 33        /// </summary>
 34        /// <remarks>
 35        /// Required.
 36        /// </remarks>
 37        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 38        public int Id { get; private set; }
 39
 40        /// <summary>
 41        /// Gets or sets the user Id.
 42        /// </summary>
 43        /// <remarks>
 44        /// Required.
 45        /// </remarks>
 46        public Guid UserId { get; set; }
 47
 48        /// <summary>
 49        /// Gets or sets the id of the associated item.
 50        /// </summary>
 51        /// <remarks>
 52        /// Required.
 53        /// </remarks>
 54        public Guid ItemId { get; set; }
 55
 56        /// <summary>
 57        /// Gets or sets the client string.
 58        /// </summary>
 59        /// <remarks>
 60        /// Required. Max Length = 32.
 61        /// </remarks>
 62        [MaxLength(32)]
 63        [StringLength(32)]
 64        public string Client { get; set; }
 65
 66        /// <summary>
 67        /// Gets or sets the view type.
 68        /// </summary>
 69        /// <remarks>
 70        /// Required.
 71        /// </remarks>
 72        public ViewType ViewType { get; set; }
 73
 74        /// <summary>
 75        /// Gets or sets a value indicating whether the indexing should be remembered.
 76        /// </summary>
 77        /// <remarks>
 78        /// Required.
 79        /// </remarks>
 80        public bool RememberIndexing { get; set; }
 81
 82        /// <summary>
 83        /// Gets or sets what the view should be indexed by.
 84        /// </summary>
 85        public IndexingKind? IndexBy { get; set; }
 86
 87        /// <summary>
 88        /// Gets or sets a value indicating whether the sorting type should be remembered.
 89        /// </summary>
 90        /// <remarks>
 91        /// Required.
 92        /// </remarks>
 93        public bool RememberSorting { get; set; }
 94
 95        /// <summary>
 96        /// Gets or sets what the view should be sorted by.
 97        /// </summary>
 98        /// <remarks>
 99        /// Required.
 100        /// </remarks>
 101        [MaxLength(64)]
 102        [StringLength(64)]
 103        public string SortBy { get; set; }
 104
 105        /// <summary>
 106        /// Gets or sets the sort order.
 107        /// </summary>
 108        /// <remarks>
 109        /// Required.
 110        /// </remarks>
 111        public SortOrder SortOrder { get; set; }
 112    }
 113}