mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 00:55:13 +01:00
First step of actual update
We will now need a bootstrapper to complete the update on startup
This commit is contained in:
@@ -80,11 +80,12 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
|
||||
|
||||
progress.Report(10);
|
||||
|
||||
if (!updateInfo.IsUpdateAvailable)
|
||||
{
|
||||
progress.Report(100);
|
||||
return;
|
||||
}
|
||||
//>>> FOR TESTING
|
||||
//if (!updateInfo.IsUpdateAvailable)
|
||||
//{
|
||||
// progress.Report(100);
|
||||
// return;
|
||||
//}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
@@ -97,7 +98,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
|
||||
innerProgress = new Progress<double>();
|
||||
innerProgress.ProgressChanged += innerProgressHandler;
|
||||
|
||||
await _appHost.UpdateApplication(cancellationToken, innerProgress).ConfigureAwait(false);
|
||||
await _appHost.UpdateApplication(updateInfo.Package, cancellationToken, innerProgress).ConfigureAwait(false);
|
||||
|
||||
// Release the event handler
|
||||
innerProgress.ProgressChanged -= innerProgressHandler;
|
||||
|
||||
@@ -47,8 +47,8 @@ namespace MediaBrowser.Common.Implementations.Updates
|
||||
{
|
||||
// Target based on if it is an archive or single assembly
|
||||
// zip archives are assumed to contain directory structures relative to our ProgramDataPath
|
||||
var isArchive = string.Equals(Path.GetExtension(package.sourceUrl), ".zip", StringComparison.OrdinalIgnoreCase);
|
||||
var target = isArchive ? appPaths.ProgramDataPath : Path.Combine(appPaths.PluginsPath, package.targetFilename);
|
||||
var isArchive = string.Equals(Path.GetExtension(package.targetFilename), ".zip", StringComparison.OrdinalIgnoreCase);
|
||||
var target = isArchive ? appPaths.TempUpdatePath : Path.Combine(appPaths.PluginsPath, package.targetFilename);
|
||||
|
||||
// Download to temporary file so that, if interrupted, it won't destroy the existing installation
|
||||
var tempFile = await client.GetTempFile(package.sourceUrl, resourcePool.Mb, cancellationToken, progress).ConfigureAwait(false);
|
||||
@@ -100,5 +100,6 @@ namespace MediaBrowser.Common.Implementations.Updates
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user