Cleanup Conflicts in Sonarr/Lidarr Pulls

Co-Authored-By: Robin Dadswell <19610103+RobinDadswell@users.noreply.github.com>
This commit is contained in:
Qstick
2021-01-24 02:22:50 -05:00
parent ffc12656ee
commit 93ba5ade9e
298 changed files with 4460 additions and 4508 deletions
@@ -125,16 +125,16 @@ namespace NzbDrone.Common.Test.DiskTests
[Test]
public void should_be_able_to_delete_nested_empty_subdirs()
{
var artistDir = Path.Combine(GetTempFilePath(), "Artist");
var albumDir = Path.Combine(artistDir, "Album");
var authorDir = Path.Combine(GetTempFilePath(), "Author");
var bookDir = Path.Combine(authorDir, "Book");
Directory.CreateDirectory(Path.Combine(albumDir));
Directory.CreateDirectory(Path.Combine(albumDir, "Album"));
Directory.CreateDirectory(Path.Combine(albumDir, "Album", "CD1"));
Directory.CreateDirectory(Path.Combine(albumDir, "Album", "CD2"));
Directory.CreateDirectory(Path.Combine(bookDir));
Directory.CreateDirectory(Path.Combine(bookDir, "Book"));
Directory.CreateDirectory(Path.Combine(bookDir, "Book", "CD1"));
Directory.CreateDirectory(Path.Combine(bookDir, "Book", "CD2"));
Subject.RemoveEmptySubfolders(artistDir);
Directory.Exists(albumDir).Should().BeFalse();
Subject.RemoveEmptySubfolders(authorDir);
Directory.Exists(bookDir).Should().BeFalse();
}
[Test]
@@ -283,13 +283,13 @@ namespace NzbDrone.Common.Test.Http
{
var file = GetTempFilePath();
var url = "https://lidarr.audio/img/slider/artistdetails.png";
var url = "https://readarr.com/img/slider/artistdetails.png";
Subject.DownloadFile(url, file);
var fileInfo = new FileInfo(file);
fileInfo.Exists.Should().BeTrue();
fileInfo.Length.Should().Be(146122);
fileInfo.Length.Should().Be(192367);
}
[Test]
@@ -298,7 +298,7 @@ namespace NzbDrone.Common.Test.Http
var file = GetTempFilePath();
var request = new HttpRequestBuilder($"https://{_httpBinHost}/redirect-to")
.AddQueryParam("url", $"https://lidarr.audio/img/slider/artistdetails.png")
.AddQueryParam("url", $"https://readarr.com/img/slider/artistdetails.png")
.Build();
Subject.DownloadFile(request.Url.FullUri, file);
@@ -307,7 +307,7 @@ namespace NzbDrone.Common.Test.Http
var fileInfo = new FileInfo(file);
fileInfo.Exists.Should().BeTrue();
fileInfo.Length.Should().Be(146122);
fileInfo.Length.Should().Be(192367);
}
[Test]
@@ -17,9 +17,11 @@ namespace NzbDrone.Common.Test.InstrumentationTests
[TestCase(@"https://baconbits.org/feeds.php?feed=torrents_tv&user=12345&auth=2b51db35e1910123321025a12b9933d2&passkey=mySecret&authkey=2b51db35e1910123321025a12b9933d2")]
[TestCase(@"http://127.0.0.1:9117/dl/indexername?jackett_apikey=flwjiefewklfjacketmySecretsdfldskjfsdlk&path=we0re9f0sdfbase64sfdkfjsdlfjk&file=The+Torrent+File+Name.torrent")]
[TestCase(@"http://nzb.su/getnzb/2b51db35e1912ffc138825a12b9933d2.nzb&i=37292&r=2b51db35e1910123321025a12b9933d2")]
// NzbGet
[TestCase(@"{ ""Name"" : ""ControlUsername"", ""Value"" : ""mySecret"" }, { ""Name"" : ""ControlPassword"", ""Value"" : ""mySecret"" }, ")]
[TestCase(@"{ ""Name"" : ""Server1.Username"", ""Value"" : ""mySecret"" }, { ""Name"" : ""Server1.Password"", ""Value"" : ""mySecret"" }, ")]
// Sabnzbd
[TestCase(@"http://127.0.0.1:1234/api/call?vv=1&apikey=mySecret")]
[TestCase(@"http://127.0.0.1:1234/api/call?vv=1&ma_username=mySecret&ma_password=mySecret")]
@@ -30,6 +32,7 @@ namespace NzbDrone.Common.Test.InstrumentationTests
[TestCase(@"""misc"":{""username"":""mySecret"",""api_key"":""mySecret"",""password"":""mySecret"",""nzb_key"":""mySecret""}")]
[TestCase(@"""servers"":[{""username"":""mySecret"",""password"":""mySecret""}]")]
[TestCase(@"""misc"":{""email_account"":""mySecret"",""email_to"":[],""email_from"":"""",""email_pwd"":""mySecret""}")]
// uTorrent
[TestCase(@"http://localhost:9091/gui/?token=wThmph5l0ZXfH-a6WOA4lqiLvyjCP0FpMrMeXmySecret_VXBO11HoKL751MAAAAA&list=1")]
[TestCase(@",[""boss_key"",0,""mySecret"",{""access"":""Y""}],[""boss_key_salt"",0,""mySecret"",{""access"":""W""}]")]
@@ -37,18 +40,23 @@ namespace NzbDrone.Common.Test.InstrumentationTests
[TestCase(@",[""webui.uconnect_username"",2,""mySecret"",{""access"":""Y""}],[""webui.uconnect_password"",2,""mySecret"",{""access"":""Y""}]")]
[TestCase(@",[""proxy.proxy"",2,""mySecret"",{""access"":""Y""}]")]
[TestCase(@",[""proxy.username"",2,""mySecret"",{""access"":""Y""}],[""proxy.password"",2,""mySecret"",{""access"":""Y""}]")]
// Deluge
[TestCase(@",{""download_location"": ""C:\Users\\mySecret mySecret\\Downloads""}")]
[TestCase(@",{""download_location"": ""/home/mySecret/Downloads""}")]
[TestCase(@"auth.login(""mySecret"")")]
// Download Station
[TestCase(@"webapi/entry.cgi?api=(removed)&version=2&method=login&account=01233210&passwd=mySecret&format=sid&session=DownloadStation")]
// BroadcastheNet
[TestCase(@"method: ""getTorrents"", ""params"": [ ""mySecret"",")]
[TestCase(@"getTorrents(""mySecret"", [asdfasdf], 100, 0)")]
[TestCase(@"""DownloadURL"":""https:\/\/broadcasthe.net\/torrents.php?action=download&id=123&authkey=mySecret&torrent_pass=mySecret""")]
// Spotify Refresh
[TestCase(@"https://auth.servarr.com/renew?refresh_token=mySecret")]
// Plex
[TestCase(@" http://localhost:32400/library/metadata/12345/refresh?X-Plex-Client-Identifier=1234530f-422f-4aac-b6b3-01233210aaaa&X-Plex-Product=Sonarr&X-Plex-Platform=Windows&X-Plex-Platform-Version=7&X-Plex-Device-Name=Sonarr&X-Plex-Version=3.0.3.833&X-Plex-Token=mySecret")]
public void should_clean_message(string message)
@@ -292,28 +292,28 @@ namespace NzbDrone.Common.Test
public void GetAncestorFolders_should_return_all_ancestors_in_path_Windows()
{
WindowsOnly();
var path = @"C:\Test\Music\Artist Title";
var path = @"C:\Test\Music\Author Title";
var result = path.GetAncestorFolders();
result.Count.Should().Be(4);
result[0].Should().Be(@"C:\");
result[1].Should().Be(@"Test");
result[2].Should().Be(@"Music");
result[3].Should().Be(@"Artist Title");
result[3].Should().Be(@"Author Title");
}
[Test]
public void GetAncestorFolders_should_return_all_ancestors_in_path_Linux()
{
PosixOnly();
var path = @"/Test/Music/Artist Title";
var path = @"/Test/Music/Author Title";
var result = path.GetAncestorFolders();
result.Count.Should().Be(4);
result[0].Should().Be(@"/");
result[1].Should().Be(@"Test");
result[2].Should().Be(@"Music");
result[3].Should().Be(@"Artist Title");
result[3].Should().Be(@"Author Title");
}
}
}