Add tracking of JF version used to run this config previously
This commit is contained in:
parent
e80c9bb8c6
commit
acd67c7152
|
@ -41,6 +41,16 @@ namespace Jellyfin.Server
|
||||||
networkManager,
|
networkManager,
|
||||||
configuration)
|
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 />
|
/// <inheritdoc />
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
using System;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Configuration
|
namespace MediaBrowser.Model.Configuration
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -25,6 +28,24 @@ namespace MediaBrowser.Model.Configuration
|
||||||
/// <value>The cache path.</value>
|
/// <value>The cache path.</value>
|
||||||
public string CachePath { get; set; }
|
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>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
|
/// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user