Add tracking of JF version used to run this config previously

pull/2515/head
Vasily 4 years ago
parent e80c9bb8c6
commit acd67c7152

@ -41,6 +41,16 @@ namespace Jellyfin.Server
networkManager,
configuration)
{
var previousVersion = ConfigurationManager.CommonConfiguration.PreviousVersion;
if (ApplicationVersion.CompareTo(previousVersion) > 0)
{
Logger.LogWarning("Version check shows Jellyfin was updated: previous version={0}, current version={1}", previousVersion, ApplicationVersion);
// TODO: run update routines
ConfigurationManager.CommonConfiguration.PreviousVersion = ApplicationVersion;
ConfigurationManager.SaveConfiguration();
}
}
/// <inheritdoc />

@ -1,3 +1,6 @@
using System;
using System.Xml.Serialization;
namespace MediaBrowser.Model.Configuration
{
/// <summary>
@ -25,6 +28,24 @@ namespace MediaBrowser.Model.Configuration
/// <value>The cache path.</value>
public string CachePath { get; set; }
/// <summary>
/// Last known version that was ran using the configuration.
/// </summary>
/// <value>The version from previous run.</value>
[XmlIgnore]
public Version PreviousVersion { get; set; }
/// <summary>
/// Stringified PreviousVersion to be stored/loaded,
/// because System.Version itself isn't xml-serializable
/// </summary>
/// <value>String value of PreviousVersion</value>
public string PreviousVersionStr
{
get => PreviousVersion?.ToString();
set => PreviousVersion = Version.Parse(value);
}
/// <summary>
/// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
/// </summary>

Loading…
Cancel
Save