BaseApplicationConfiguration.cs 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using MediaBrowser.Model.Updates;
  2. using ProtoBuf;
  3. namespace MediaBrowser.Model.Configuration
  4. {
  5. /// <summary>
  6. /// Serves as a common base class for the Server and UI application Configurations
  7. /// ProtoInclude tells Protobuf about subclasses,
  8. /// 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.
  9. /// </summary>
  10. [ProtoContract, ProtoInclude(965, typeof(ServerConfiguration))]
  11. public class BaseApplicationConfiguration
  12. {
  13. /// <summary>
  14. /// Gets or sets a value indicating whether [enable debug level logging].
  15. /// </summary>
  16. /// <value><c>true</c> if [enable debug level logging]; otherwise, <c>false</c>.</value>
  17. [ProtoMember(1)]
  18. public bool EnableDebugLevelLogging { get; set; }
  19. /// <summary>
  20. /// Gets or sets a value indicating whether [enable HTTP level logging].
  21. /// </summary>
  22. /// <value><c>true</c> if [enable HTTP level logging]; otherwise, <c>false</c>.</value>
  23. [ProtoMember(56)]
  24. public bool EnableHttpLevelLogging { get; set; }
  25. /// <summary>
  26. /// Gets or sets the HTTP server port number.
  27. /// </summary>
  28. /// <value>The HTTP server port number.</value>
  29. [ProtoMember(2)]
  30. public int HttpServerPortNumber { get; set; }
  31. /// <summary>
  32. /// Enable automatically and silently updating of the application
  33. /// </summary>
  34. /// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value>
  35. [ProtoMember(3)]
  36. public bool EnableAutoUpdate { get; set; }
  37. /// <summary>
  38. /// Gets of sets a value indicating the level of system updates (Release, Beta, Dev)
  39. /// </summary>
  40. [ProtoMember(60)]
  41. public PackageVersionClass SystemUpdateLevel { get; set; }
  42. /// <summary>
  43. /// The number of days we should retain log files
  44. /// </summary>
  45. /// <value>The log file retention days.</value>
  46. [ProtoMember(5)]
  47. public int LogFileRetentionDays { get; set; }
  48. /// <summary>
  49. /// Gets or sets a value indicating whether [run at startup].
  50. /// </summary>
  51. /// <value><c>true</c> if [run at startup]; otherwise, <c>false</c>.</value>
  52. [ProtoMember(58)]
  53. public bool RunAtStartup { get; set; }
  54. /// <summary>
  55. /// Gets or sets the legacy web socket port number.
  56. /// </summary>
  57. /// <value>The legacy web socket port number.</value>
  58. [ProtoMember(59)]
  59. public int LegacyWebSocketPortNumber { get; set; }
  60. /// <summary>
  61. /// Gets or sets a value indicating whether this instance is first run.
  62. /// </summary>
  63. /// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
  64. [ProtoMember(4)]
  65. public bool IsStartupWizardCompleted { get; set; }
  66. /// <summary>
  67. /// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
  68. /// </summary>
  69. public BaseApplicationConfiguration()
  70. {
  71. HttpServerPortNumber = 8096;
  72. LegacyWebSocketPortNumber = 8945;
  73. EnableAutoUpdate = true;
  74. LogFileRetentionDays = 14;
  75. EnableHttpLevelLogging = true;
  76. #if (DEBUG)
  77. EnableDebugLevelLogging = true;
  78. #endif
  79. }
  80. }
  81. }