< Summary - Jellyfin

Information
Class: Jellyfin.Data.Entities.DisplayPreferences
Assembly: Jellyfin.Data
File(s): /srv/git/jellyfin/Jellyfin.Data/Entities/DisplayPreferences.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 150
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/DisplayPreferences.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel.DataAnnotations;
 4using System.ComponentModel.DataAnnotations.Schema;
 5using Jellyfin.Data.Enums;
 6
 7namespace Jellyfin.Data.Entities
 8{
 9    /// <summary>
 10    /// An entity representing a user's display preferences.
 11    /// </summary>
 12    public class DisplayPreferences
 13    {
 14        /// <summary>
 15        /// Initializes a new instance of the <see cref="DisplayPreferences"/> class.
 16        /// </summary>
 17        /// <param name="userId">The user's id.</param>
 18        /// <param name="itemId">The item id.</param>
 19        /// <param name="client">The client string.</param>
 20        public DisplayPreferences(Guid userId, Guid itemId, string client)
 21        {
 022            UserId = userId;
 023            ItemId = itemId;
 024            Client = client;
 025            ShowSidebar = false;
 026            ShowBackdrop = true;
 027            SkipForwardLength = 30000;
 028            SkipBackwardLength = 10000;
 029            ScrollDirection = ScrollDirection.Horizontal;
 030            ChromecastVersion = ChromecastVersion.Stable;
 31
 032            HomeSections = new HashSet<HomeSection>();
 033        }
 34
 35        /// <summary>
 36        /// Gets the Id.
 37        /// </summary>
 38        /// <remarks>
 39        /// Required.
 40        /// </remarks>
 41        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 42        public int Id { get; private set; }
 43
 44        /// <summary>
 45        /// Gets or sets the user Id.
 46        /// </summary>
 47        /// <remarks>
 48        /// Required.
 49        /// </remarks>
 50        public Guid UserId { get; set; }
 51
 52        /// <summary>
 53        /// Gets or sets the id of the associated item.
 54        /// </summary>
 55        /// <remarks>
 56        /// Required.
 57        /// </remarks>
 58        public Guid ItemId { get; set; }
 59
 60        /// <summary>
 61        /// Gets or sets the client string.
 62        /// </summary>
 63        /// <remarks>
 64        /// Required. Max Length = 32.
 65        /// </remarks>
 66        [MaxLength(32)]
 67        [StringLength(32)]
 68        public string Client { get; set; }
 69
 70        /// <summary>
 71        /// Gets or sets a value indicating whether to show the sidebar.
 72        /// </summary>
 73        /// <remarks>
 74        /// Required.
 75        /// </remarks>
 76        public bool ShowSidebar { get; set; }
 77
 78        /// <summary>
 79        /// Gets or sets a value indicating whether to show the backdrop.
 80        /// </summary>
 81        /// <remarks>
 82        /// Required.
 83        /// </remarks>
 84        public bool ShowBackdrop { get; set; }
 85
 86        /// <summary>
 87        /// Gets or sets the scroll direction.
 88        /// </summary>
 89        /// <remarks>
 90        /// Required.
 91        /// </remarks>
 92        public ScrollDirection ScrollDirection { get; set; }
 93
 94        /// <summary>
 95        /// Gets or sets what the view should be indexed by.
 96        /// </summary>
 97        public IndexingKind? IndexBy { get; set; }
 98
 99        /// <summary>
 100        /// Gets or sets the length of time to skip forwards, in milliseconds.
 101        /// </summary>
 102        /// <remarks>
 103        /// Required.
 104        /// </remarks>
 105        public int SkipForwardLength { get; set; }
 106
 107        /// <summary>
 108        /// Gets or sets the length of time to skip backwards, in milliseconds.
 109        /// </summary>
 110        /// <remarks>
 111        /// Required.
 112        /// </remarks>
 113        public int SkipBackwardLength { get; set; }
 114
 115        /// <summary>
 116        /// Gets or sets the Chromecast Version.
 117        /// </summary>
 118        /// <remarks>
 119        /// Required.
 120        /// </remarks>
 121        public ChromecastVersion ChromecastVersion { get; set; }
 122
 123        /// <summary>
 124        /// Gets or sets a value indicating whether the next video info overlay should be shown.
 125        /// </summary>
 126        /// <remarks>
 127        /// Required.
 128        /// </remarks>
 129        public bool EnableNextVideoInfoOverlay { get; set; }
 130
 131        /// <summary>
 132        /// Gets or sets the dashboard theme.
 133        /// </summary>
 134        [MaxLength(32)]
 135        [StringLength(32)]
 136        public string? DashboardTheme { get; set; }
 137
 138        /// <summary>
 139        /// Gets or sets the tv home screen.
 140        /// </summary>
 141        [MaxLength(32)]
 142        [StringLength(32)]
 143        public string? TvHome { get; set; }
 144
 145        /// <summary>
 146        /// Gets the home sections.
 147        /// </summary>
 148        public virtual ICollection<HomeSection> HomeSections { get; private set; }
 149    }
 150}