mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Branch redirects will now occur during install of the a new update instead of during an update check.
This commit is contained in:
@@ -102,6 +102,8 @@ namespace NzbDrone.Core.Update
|
||||
_archiveService.Extract(packageDestination, updateSandboxFolder);
|
||||
_logger.Info("Update package extracted successfully");
|
||||
|
||||
EnsureValidBranch(updatePackage);
|
||||
|
||||
_backupService.Backup(BackupType.Update);
|
||||
|
||||
if (OsInfo.IsNotWindows && _configFileProvider.UpdateMechanism == UpdateMechanism.Script)
|
||||
@@ -120,6 +122,25 @@ namespace NzbDrone.Core.Update
|
||||
_processProvider.Start(_appFolderInfo.GetUpdateClientExePath(), GetUpdaterArgs(updateSandboxFolder));
|
||||
}
|
||||
|
||||
private void EnsureValidBranch(UpdatePackage package)
|
||||
{
|
||||
var currentBranch = _configFileProvider.Branch;
|
||||
if (package.Branch != currentBranch)
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.Info("Branch [{0}] is being redirected to [{1}]]", currentBranch, package.Branch);
|
||||
var config = new Dictionary<string, object>();
|
||||
config["Branch"] = package.Branch;
|
||||
_configFileProvider.SaveConfigDictionary(config);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.ErrorException(string.Format("Couldn't change the branch from [{0}] to [{1}].", currentBranch, package.Branch), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InstallUpdateWithScript(String updateSandboxFolder)
|
||||
{
|
||||
var scriptPath = _configFileProvider.UpdateScriptPath;
|
||||
|
Reference in New Issue
Block a user