BaseApplicationConfiguration.cs 2.8 KB

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