< Summary - Jellyfin

Information
Class: MediaBrowser.Model.Configuration.BaseApplicationConfiguration
Assembly: MediaBrowser.Model
File(s): /srv/git/jellyfin/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
Line coverage
83%
Covered lines: 5
Uncovered lines: 1
Coverable lines: 6
Total lines: 63
Line coverage: 83.3%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
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%11100%
get_PreviousVersionStr()50%22100%
set_PreviousVersionStr(...)50%2.15266.66%

File(s)

/srv/git/jellyfin/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs

#LineLine coverage
 1using System;
 2using System.Xml.Serialization;
 3
 4namespace MediaBrowser.Model.Configuration
 5{
 6    /// <summary>
 7    /// Serves as a common base class for the Server and UI application Configurations
 8    /// ProtoInclude tells Protobuf about subclasses,
 9    /// The number 50 can be any number, so long as it doesn't clash with any of the ProtoMember numbers either here or 
 10    /// </summary>
 11    public class BaseApplicationConfiguration
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
 15        /// </summary>
 16        public BaseApplicationConfiguration()
 17        {
 17718            LogFileRetentionDays = 3;
 17719        }
 20
 21        /// <summary>
 22        /// Gets or sets the number of days we should retain log files.
 23        /// </summary>
 24        /// <value>The log file retention days.</value>
 25        public int LogFileRetentionDays { get; set; }
 26
 27        /// <summary>
 28        /// Gets or sets a value indicating whether this instance is first run.
 29        /// </summary>
 30        /// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
 31        public bool IsStartupWizardCompleted { get; set; }
 32
 33        /// <summary>
 34        /// Gets or sets the cache path.
 35        /// </summary>
 36        /// <value>The cache path.</value>
 37        public string? CachePath { get; set; }
 38
 39        /// <summary>
 40        /// Gets or sets the last known version that was ran using the configuration.
 41        /// </summary>
 42        /// <value>The version from previous run.</value>
 43        [XmlIgnore]
 44        public Version? PreviousVersion { get; set; }
 45
 46        /// <summary>
 47        /// Gets or sets the stringified PreviousVersion to be stored/loaded,
 48        /// because System.Version itself isn't xml-serializable.
 49        /// </summary>
 50        /// <value>String value of PreviousVersion.</value>
 51        public string? PreviousVersionStr
 52        {
 6253            get => PreviousVersion?.ToString();
 54            set
 55            {
 456                if (Version.TryParse(value, out var version))
 57                {
 058                    PreviousVersion = version;
 59                }
 460            }
 61        }
 62    }
 63}