mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-26 07:42:49 +00:00
parent
9ec56708e7
commit
adb09ffabf
2 changed files with 4 additions and 2 deletions
|
@ -87,6 +87,7 @@ public void adding_duplicated_mapping_should_throw(string host, string remotePat
|
|||
}
|
||||
|
||||
[TestCase("my-server.localdomain", "/mnt/storage/downloads/tv", @"D:\mountedstorage\downloads\tv")]
|
||||
[TestCase("My-Server.localdomain", "/mnt/storage/downloads/tv", @"D:\mountedstorage\downloads\tv")]
|
||||
[TestCase("my-2server.localdomain", "/mnt/storage/downloads/tv", "/mnt/storage/downloads/tv")]
|
||||
[TestCase("my-server.localdomain", "/mnt/storageabc/downloads/tv", "/mnt/storageabc/downloads/tv")]
|
||||
public void should_remap_remote_to_local(string host, string remotePath, string expectedLocalPath)
|
||||
|
@ -101,6 +102,7 @@ public void should_remap_remote_to_local(string host, string remotePath, string
|
|||
}
|
||||
|
||||
[TestCase("my-server.localdomain", "/mnt/storage/downloads/tv", @"D:\mountedstorage\downloads\tv")]
|
||||
[TestCase("My-Server.localdomain", "/mnt/storage/downloads/tv", @"D:\mountedstorage\downloads\tv")]
|
||||
[TestCase("my-server.localdomain", "/mnt/storage/", @"D:\mountedstorage")]
|
||||
[TestCase("my-2server.localdomain", "/mnt/storage/downloads/tv", "/mnt/storage/downloads/tv")]
|
||||
[TestCase("my-server.localdomain", "/mnt/storageabc/downloads/tv", "/mnt/storageabc/downloads/tv")]
|
||||
|
|
|
@ -129,7 +129,7 @@ public OsPath RemapRemoteToLocal(string host, OsPath remotePath)
|
|||
|
||||
foreach (var mapping in All())
|
||||
{
|
||||
if (host == mapping.Host && new OsPath(mapping.RemotePath).Contains(remotePath))
|
||||
if (host.Equals(mapping.Host, StringComparison.InvariantCultureIgnoreCase) && new OsPath(mapping.RemotePath).Contains(remotePath))
|
||||
{
|
||||
var localPath = new OsPath(mapping.LocalPath) + (remotePath - new OsPath(mapping.RemotePath));
|
||||
|
||||
|
@ -149,7 +149,7 @@ public OsPath RemapLocalToRemote(string host, OsPath localPath)
|
|||
|
||||
foreach (var mapping in All())
|
||||
{
|
||||
if (host == mapping.Host && new OsPath(mapping.LocalPath).Contains(localPath))
|
||||
if (host.Equals(mapping.Host, StringComparison.InvariantCultureIgnoreCase) && new OsPath(mapping.LocalPath).Contains(localPath))
|
||||
{
|
||||
var remotePath = new OsPath(mapping.RemotePath) + (localPath - new OsPath(mapping.LocalPath));
|
||||
|
||||
|
|
Loading…
Reference in a new issue