2020-03-05 13:22:15 +00:00
|
|
|
using System;
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
2019-01-13 20:02:23 +00:00
|
|
|
namespace MediaBrowser.Model.Configuration
|
2018-12-27 23:27:57 +00:00
|
|
|
{
|
|
|
|
/// <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>
|
2020-06-22 13:35:53 +00:00
|
|
|
/// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
|
|
|
|
/// </summary>
|
|
|
|
public BaseApplicationConfiguration()
|
|
|
|
{
|
|
|
|
LogFileRetentionDays = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the number of days we should retain log files.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </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>
|
2021-10-26 11:56:30 +00:00
|
|
|
public string? CachePath { get; set; }
|
2019-01-07 23:27:46 +00:00
|
|
|
|
2020-03-05 13:22:15 +00:00
|
|
|
/// <summary>
|
2020-06-22 13:35:53 +00:00
|
|
|
/// Gets or sets the last known version that was ran using the configuration.
|
2020-03-05 13:22:15 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The version from previous run.</value>
|
|
|
|
[XmlIgnore]
|
2021-10-26 11:56:30 +00:00
|
|
|
public Version? PreviousVersion { get; set; }
|
2020-03-05 13:22:15 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-06-22 13:35:53 +00:00
|
|
|
/// Gets or sets the stringified PreviousVersion to be stored/loaded,
|
|
|
|
/// because System.Version itself isn't xml-serializable.
|
2020-03-05 13:22:15 +00:00
|
|
|
/// </summary>
|
2020-06-22 13:35:53 +00:00
|
|
|
/// <value>String value of PreviousVersion.</value>
|
2021-10-26 11:56:30 +00:00
|
|
|
public string? PreviousVersionStr
|
2020-03-05 13:22:15 +00:00
|
|
|
{
|
|
|
|
get => PreviousVersion?.ToString();
|
2020-07-12 18:11:59 +00:00
|
|
|
set
|
|
|
|
{
|
|
|
|
if (Version.TryParse(value, out var version))
|
|
|
|
{
|
|
|
|
PreviousVersion = version;
|
|
|
|
}
|
|
|
|
}
|
2020-03-05 13:22:15 +00:00
|
|
|
}
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|