mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
Start on new update routines
This commit is contained in:
parent
0180e89310
commit
989bb48596
@ -123,10 +123,7 @@ namespace MediaBrowser.Api
|
||||
|
||||
if (updateCheckResult.IsUpdateAvailable)
|
||||
{
|
||||
result.Add(new PackageVersionInfo
|
||||
{
|
||||
versionStr = updateCheckResult.AvailableVersion.ToString()
|
||||
});
|
||||
result.Add(updateCheckResult.Package);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,6 @@ namespace MediaBrowser.Common.Constants
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const string MBAdminUrl = "http://mb3admin.com/admin/";
|
||||
public const string MBAdminUrl = "http://www.mb3admin.com/admin/";
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,15 @@ namespace MediaBrowser.Model.Updates
|
||||
/// Gets or sets the available version.
|
||||
/// </summary>
|
||||
/// <value>The available version.</value>
|
||||
public Version AvailableVersion { get; set; }
|
||||
public Version AvailableVersion
|
||||
{
|
||||
get { return Package != null ? Package.version : new Version(0, 0); }
|
||||
set { } // need this for the serializer
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get or sets package information for an available update
|
||||
/// </summary>
|
||||
public PackageVersionInfo Package { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using BDInfo;
|
||||
using System.Security;
|
||||
using BDInfo;
|
||||
using MediaBrowser.ClickOnce;
|
||||
using MediaBrowser.Common.Implementations;
|
||||
using MediaBrowser.Common.Implementations.HttpClientManager;
|
||||
@ -13,6 +14,8 @@ using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Common.Updates;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.IsoMounter;
|
||||
@ -145,7 +148,7 @@ namespace MediaBrowser.ServerApplication
|
||||
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
|
||||
public bool CanSelfUpdate
|
||||
{
|
||||
get { return ClickOnceHelper.IsNetworkDeployed; }
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -154,10 +157,14 @@ namespace MediaBrowser.ServerApplication
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <param name="progress">The progress.</param>
|
||||
/// <returns>Task{CheckForUpdateResult}.</returns>
|
||||
public Task<CheckForUpdateResult> CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress<double> progress)
|
||||
public async Task<CheckForUpdateResult> CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress<double> progress)
|
||||
{
|
||||
// Get package manager using Resolve<IPackageManager>()
|
||||
return new ApplicationUpdateCheck().CheckForApplicationUpdate(cancellationToken, progress);
|
||||
var pkgManager = Resolve<IPackageManager>();
|
||||
var availablePackages = await pkgManager.GetAvailablePackages(Resolve<IHttpClient>(), Resolve<INetworkManager>(), Kernel.SecurityManager, Kernel.ResourcePools, Resolve<IJsonSerializer>(), CancellationToken.None).ConfigureAwait(false);
|
||||
var version = Kernel.InstallationManager.GetLatestCompatibleVersion(availablePackages, "MBServer", Kernel.Configuration.SystemUpdateLevel);
|
||||
|
||||
return version != null ? new CheckForUpdateResult {AvailableVersion = version.version, IsUpdateAvailable = version.version > ApplicationVersion, Package = version} :
|
||||
new CheckForUpdateResult();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user