aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs')
-rw-r--r--MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs37
1 files changed, 32 insertions, 5 deletions
diff --git a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
index 6a1a0f090..57759a7d3 100644
--- a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
@@ -1,3 +1,6 @@
+using System;
+using System.Xml.Serialization;
+
namespace MediaBrowser.Model.Configuration
{
/// <summary>
@@ -8,7 +11,15 @@ namespace MediaBrowser.Model.Configuration
public class BaseApplicationConfiguration
{
/// <summary>
- /// The number of days we should retain log files
+ /// 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.
/// </summary>
/// <value>The log file retention days.</value>
public int LogFileRetentionDays { get; set; }
@@ -23,14 +34,30 @@ namespace MediaBrowser.Model.Configuration
/// Gets or sets the cache path.
/// </summary>
/// <value>The cache path.</value>
- public string CachePath { get; set; }
+ public string? CachePath { get; set; }
/// <summary>
- /// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
+ /// Gets or sets the last known version that was ran using the configuration.
/// </summary>
- public BaseApplicationConfiguration()
+ /// <value>The version from previous run.</value>
+ [XmlIgnore]
+ public Version? PreviousVersion { get; set; }
+
+ /// <summary>
+ /// Gets or sets the stringified PreviousVersion to be stored/loaded,
+ /// because System.Version itself isn't xml-serializable.
+ /// </summary>
+ /// <value>String value of PreviousVersion.</value>
+ public string? PreviousVersionStr
{
- LogFileRetentionDays = 3;
+ get => PreviousVersion?.ToString();
+ set
+ {
+ if (Version.TryParse(value, out var version))
+ {
+ PreviousVersion = version;
+ }
+ }
}
}
}