aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
blob: 474d985f2feaf06a7f34b1b45dfbbe45d01c2b83 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using MediaBrowser.Model.Updates;
using ProtoBuf;

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>
    [ProtoContract, ProtoInclude(965, typeof(ServerConfiguration))]
    public class BaseApplicationConfiguration
    {
        /// <summary>
        /// Gets or sets a value indicating whether [enable debug level logging].
        /// </summary>
        /// <value><c>true</c> if [enable debug level logging]; otherwise, <c>false</c>.</value>
        [ProtoMember(1)]
        public bool EnableDebugLevelLogging { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [enable HTTP level logging].
        /// </summary>
        /// <value><c>true</c> if [enable HTTP level logging]; otherwise, <c>false</c>.</value>
        [ProtoMember(56)]
        public bool EnableHttpLevelLogging { get; set; }

        /// <summary>
        /// Gets or sets the HTTP server port number.
        /// </summary>
        /// <value>The HTTP server port number.</value>
        [ProtoMember(2)]
        public int HttpServerPortNumber { get; set; }

        /// <summary>
        /// Enable automatically and silently updating of the application
        /// </summary>
        /// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value>
        [ProtoMember(3)]
        public bool EnableAutoUpdate { get; set; }

        /// <summary>
        /// Gets of sets a value indicating the level of system updates (Release, Beta, Dev)
        /// </summary>
        [ProtoMember(60)]
        public PackageVersionClass SystemUpdateLevel { get; set; }

        /// <summary>
        /// The number of days we should retain log files
        /// </summary>
        /// <value>The log file retention days.</value>
        [ProtoMember(5)]
        public int LogFileRetentionDays { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [run at startup].
        /// </summary>
        /// <value><c>true</c> if [run at startup]; otherwise, <c>false</c>.</value>
        [ProtoMember(58)]
        public bool RunAtStartup { get; set; }

        /// <summary>
        /// Gets or sets the legacy web socket port number.
        /// </summary>
        /// <value>The legacy web socket port number.</value>
        [ProtoMember(59)]
        public int LegacyWebSocketPortNumber { get; set; }
        
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
        /// </summary>
        public BaseApplicationConfiguration()
        {
            HttpServerPortNumber = 8096;
            LegacyWebSocketPortNumber = 8945;

            EnableAutoUpdate = true;
            LogFileRetentionDays = 14;

            EnableHttpLevelLogging = true;

#if (DEBUG)
            EnableDebugLevelLogging = true;
#endif
        }
    }
}