mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 03:38:26 -07:00
Fixed: Regression causing updater to fail (manual update required if on 3.0.3.971, see forums)
This commit is contained in:
parent
2c22ed2912
commit
c92b254bb7
3 changed files with 30 additions and 4 deletions
|
@ -662,6 +662,23 @@ namespace NzbDrone.Common.Test.DiskTests
|
||||||
VerifyCopyFolder(original.FullName, destination.FullName);
|
VerifyCopyFolder(original.FullName, destination.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void MirrorFolder_should_handle_trailing_slash()
|
||||||
|
{
|
||||||
|
WithRealDiskProvider();
|
||||||
|
|
||||||
|
var original = GetFilledTempFolder();
|
||||||
|
var source = new DirectoryInfo(GetTempFilePath());
|
||||||
|
var destination = new DirectoryInfo(GetTempFilePath());
|
||||||
|
|
||||||
|
Subject.TransferFolder(original.FullName, source.FullName, TransferMode.Copy);
|
||||||
|
|
||||||
|
var count = Subject.MirrorFolder(source.FullName + Path.DirectorySeparatorChar, destination.FullName);
|
||||||
|
|
||||||
|
count.Should().Equals(3);
|
||||||
|
VerifyCopyFolder(original.FullName, destination.FullName);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TransferFolder_should_use_movefolder_if_on_same_mount()
|
public void TransferFolder_should_use_movefolder_if_on_same_mount()
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,13 +30,16 @@ namespace NzbDrone.Common.Disk
|
||||||
private string ResolveRealParentPath(string path)
|
private string ResolveRealParentPath(string path)
|
||||||
{
|
{
|
||||||
var parentPath = path.GetParentPath();
|
var parentPath = path.GetParentPath();
|
||||||
if (!_diskProvider.FolderExists(path))
|
if (!_diskProvider.FolderExists(parentPath))
|
||||||
{
|
{
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
parentPath = parentPath.GetActualCasing();
|
var realParentPath = parentPath.GetActualCasing();
|
||||||
return parentPath + Path.DirectorySeparatorChar + Path.GetFileName(path);
|
|
||||||
|
var partialChildPath = path.Substring(parentPath.Length);
|
||||||
|
|
||||||
|
return realParentPath + partialChildPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransferMode TransferFolder(string sourcePath, string targetPath, TransferMode mode)
|
public TransferMode TransferFolder(string sourcePath, string targetPath, TransferMode mode)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
|
@ -90,6 +90,12 @@ namespace NzbDrone.Update.UpdateEngine
|
||||||
|
|
||||||
Verify(installationFolder, processId);
|
Verify(installationFolder, processId);
|
||||||
|
|
||||||
|
if (installationFolder.EndsWith(@"\bin\Lidarr") || installationFolder.EndsWith(@"/bin/Lidarr"))
|
||||||
|
{
|
||||||
|
installationFolder = installationFolder.GetParentPath();
|
||||||
|
_logger.Info("Fixed Installation Folder: {0}", installationFolder);
|
||||||
|
}
|
||||||
|
|
||||||
var appType = _detectApplicationType.GetAppType();
|
var appType = _detectApplicationType.GetAppType();
|
||||||
|
|
||||||
_processProvider.FindProcessByName(ProcessProvider.LIDARR_CONSOLE_PROCESS_NAME);
|
_processProvider.FindProcessByName(ProcessProvider.LIDARR_CONSOLE_PROCESS_NAME);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue