BaseApplicationConfiguration.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #nullable disable
  2. using System;
  3. using System.Xml.Serialization;
  4. namespace 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 in subclasses.
  10. /// </summary>
  11. public class BaseApplicationConfiguration
  12. {
  13. /// <summary>
  14. /// The number of days we should retain log files
  15. /// </summary>
  16. /// <value>The log file retention days.</value>
  17. public int LogFileRetentionDays { get; set; }
  18. /// <summary>
  19. /// Gets or sets a value indicating whether this instance is first run.
  20. /// </summary>
  21. /// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
  22. public bool IsStartupWizardCompleted { get; set; }
  23. /// <summary>
  24. /// Gets or sets the cache path.
  25. /// </summary>
  26. /// <value>The cache path.</value>
  27. public string CachePath { get; set; }
  28. /// <summary>
  29. /// Last known version that was ran using the configuration.
  30. /// </summary>
  31. /// <value>The version from previous run.</value>
  32. [XmlIgnore]
  33. public Version PreviousVersion { get; set; }
  34. /// <summary>
  35. /// Stringified PreviousVersion to be stored/loaded,
  36. /// because System.Version itself isn't xml-serializable
  37. /// </summary>
  38. /// <value>String value of PreviousVersion</value>
  39. public string PreviousVersionStr
  40. {
  41. get => PreviousVersion?.ToString();
  42. set => PreviousVersion = Version.Parse(value);
  43. }
  44. /// <summary>
  45. /// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
  46. /// </summary>
  47. public BaseApplicationConfiguration()
  48. {
  49. LogFileRetentionDays = 3;
  50. }
  51. }
  52. }