aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
blob: cdd322c94814e71de2a36c7128231deeff0266c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#nullable disable
using System;
using System.Xml.Serialization;

namespace MediaBrowser.Model.Configuration
{
    /// <summary>
    /// Serves as a common base class for the Server and UI application Configurations
    /// ProtoInclude tells Protobuf about subclasses,
    /// The number 50 can be any number, so long as it doesn't clash with any of the ProtoMember numbers either here or in subclasses.
    /// </summary>
    public class BaseApplicationConfiguration
    {
        /// <summary>
        /// The number of days we should retain log files
        /// </summary>
        /// <value>The log file retention days.</value>
        public int LogFileRetentionDays { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is first run.
        /// </summary>
        /// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
        public bool IsStartupWizardCompleted { get; set; }

        /// <summary>
        /// Gets or sets the cache path.
        /// </summary>
        /// <value>The cache path.</value>
        public string CachePath { get; set; }

        /// <summary>
        /// Last known version that was ran using the configuration.
        /// </summary>
        /// <value>The version from previous run.</value>
        [XmlIgnore]
        public Version PreviousVersion { get; set; }

        /// <summary>
        /// Stringified PreviousVersion to be stored/loaded,
        /// because System.Version itself isn't xml-serializable
        /// </summary>
        /// <value>String value of PreviousVersion</value>
        public string PreviousVersionStr
        {
            get => PreviousVersion?.ToString();
            set => PreviousVersion = Version.Parse(value);
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
        /// </summary>
        public BaseApplicationConfiguration()
        {
            LogFileRetentionDays = 3;
        }
    }
}