New: Lidarr to Readarr

This commit is contained in:
Qstick
2020-02-29 15:51:29 -05:00
parent 7359c2a9fa
commit 3b7eb01918
565 changed files with 1669 additions and 4272 deletions
@@ -33,7 +33,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
protected DownloadStationTask _multipleFilesCompleted;
protected string _serialNumber = "SERIALNUMBER";
protected string _category = "lidarr";
protected string _category = "readarr";
protected string _musicDirectory = @"music/Artist";
protected string _defaultDestination = "somepath";
protected OsPath _physicalPath = new OsPath("/mnt/sdb1/mydata");
@@ -28,7 +28,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
protected DownloadStationTask _seeding;
protected string _serialNumber = "SERIALNUMBER";
protected string _category = "lidarr";
protected string _category = "readarr";
protected string _musicDirectory = @"music/Artist";
protected string _defaultDestination = "somepath";
protected OsPath _physicalPath = new OsPath("/mnt/sdb1/mydata");
@@ -37,7 +37,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.HadoukenTests
DownloadedBytes = 0,
Progress = 0.0,
SavePath = "somepath",
Label = "lidarr-music"
Label = "readarr-music"
};
_downloading = new HadoukenTorrent
@@ -50,7 +50,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.HadoukenTests
DownloadedBytes = 100,
Progress = 10.0,
SavePath = "somepath",
Label = "lidarr-music"
Label = "readarr-music"
};
_failed = new HadoukenTorrent
@@ -64,7 +64,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.HadoukenTests
DownloadedBytes = 100,
Progress = 10.0,
SavePath = "somepath",
Label = "lidarr-music"
Label = "readarr-music"
};
_completed = new HadoukenTorrent
@@ -77,7 +77,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.HadoukenTests
DownloadedBytes = 1000,
Progress = 100.0,
SavePath = "somepath",
Label = "lidarr-music"
Label = "readarr-music"
};
Mocker.GetMock<ITorrentFileInfoReader>()
@@ -238,7 +238,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.HadoukenTests
DownloadedBytes = 1000,
Progress = 100.0,
SavePath = "somepath",
Label = "lidarr-music"
Label = "readarr-music"
};
var torrents = new HadoukenTorrent[] { torrent };
@@ -265,7 +265,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.HadoukenTests
DownloadedBytes = 1000,
Progress = 100.0,
SavePath = "somepath",
Label = "lidarr-music-other"
Label = "readarr-music-other"
};
var torrents = new HadoukenTorrent[] { torrent };
@@ -59,7 +59,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
protected void GivenRedirectToTorrent()
{
var httpHeader = new HttpHeader();
httpHeader["Location"] = "http://test.lidarr.audio/not-a-real-torrent.torrent";
httpHeader["Location"] = "http://test.readarr.audio/not-a-real-torrent.torrent";
Mocker.GetMock<IHttpClient>()
.Setup(s => s.Get(It.Is<HttpRequest>(h => h.Url.FullUri == _downloadUrl)))
@@ -577,7 +577,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
[Test]
public void should_get_category_from_the_category_if_set()
{
const string category = "music-lidarr";
const string category = "music-readarr";
GivenGlobalSeedLimits(1.0f);
var torrent = new QBittorrentTorrent
@@ -602,7 +602,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
[Test]
public void should_get_category_from_the_label_if_the_category_is_not_available()
{
const string category = "music-lidarr";
const string category = "music-readarr";
GivenGlobalSeedLimits(1.0f);
var torrent = new QBittorrentTorrent
@@ -351,7 +351,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
{
Mocker.GetMock<ISabnzbdProxy>()
.Setup(s => s.DownloadNzb(It.IsAny<byte[]>(), It.IsAny<string>(), It.IsAny<string>(), (int)SabnzbdPriority.High, It.IsAny<SabnzbdSettings>()))
.Returns(new SabnzbdAddResponse { Ids = new List<string> { "lidarrtest" } });
.Returns(new SabnzbdAddResponse { Ids = new List<string> { "readarrtest" } });
var remoteAlbum = CreateRemoteAlbum();
remoteAlbum.Albums = Builder<Album>.CreateListOfSize(1)
@@ -78,7 +78,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<ITransmissionProxy>()
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/Lidarr", It.IsAny<TransmissionSettings>()), Times.Once());
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/Readarr", It.IsAny<TransmissionSettings>()), Times.Once());
}
[Test]
@@ -94,7 +94,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<ITransmissionProxy>()
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/transmission/Lidarr", It.IsAny<TransmissionSettings>()), Times.Once());
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/transmission/Readarr", It.IsAny<TransmissionSettings>()), Times.Once());
}
[Test]
@@ -112,7 +112,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<ITransmissionProxy>()
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/transmission/Lidarr", It.IsAny<TransmissionSettings>()), Times.Once());
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/transmission/Readarr", It.IsAny<TransmissionSettings>()), Times.Once());
}
[Test]
@@ -209,7 +209,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
{
GivenMusicCategory();
_downloading.DownloadDir = @"C:/Downloads/Finished/transmission/Lidarr";
_downloading.DownloadDir = @"C:/Downloads/Finished/transmission/Readarr";
GivenTorrents(new List<TransmissionTorrent>
{
@@ -228,7 +228,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
{
GivenTvDirectory();
_downloading.DownloadDir = @"C:/Downloads/Finished/Lidarr/subdir";
_downloading.DownloadDir = @"C:/Downloads/Finished/Readarr/subdir";
GivenTorrents(new List<TransmissionTorrent>
{
@@ -114,12 +114,12 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
protected void GivenMusicCategory()
{
_settings.MusicCategory = "Lidarr";
_settings.MusicCategory = "Readarr";
}
protected void GivenTvDirectory()
{
_settings.TvDirectory = @"C:/Downloads/Finished/Lidarr";
_settings.TvDirectory = @"C:/Downloads/Finished/Readarr";
}
protected void GivenFailedDownload()
@@ -30,7 +30,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
Port = 2222,
Username = "admin",
Password = "pass",
MusicCategory = "lidarr"
MusicCategory = "readarr"
};
_queued = new UTorrentTorrent
@@ -41,7 +41,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
Size = 1000,
Remaining = 1000,
Progress = 0,
Label = "lidarr",
Label = "readarr",
DownloadUrl = _downloadUrl,
RootDownloadPath = "somepath"
};
@@ -54,7 +54,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
Size = 1000,
Remaining = 100,
Progress = 0.9,
Label = "lidarr",
Label = "readarr",
DownloadUrl = _downloadUrl,
RootDownloadPath = "somepath"
};
@@ -67,7 +67,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
Size = 1000,
Remaining = 100,
Progress = 0.9,
Label = "lidarr",
Label = "readarr",
DownloadUrl = _downloadUrl,
RootDownloadPath = "somepath"
};
@@ -80,7 +80,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
Size = 1000,
Remaining = 0,
Progress = 1.0,
Label = "lidarr",
Label = "readarr",
DownloadUrl = _downloadUrl,
RootDownloadPath = "somepath"
};
@@ -107,7 +107,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
protected void GivenRedirectToTorrent()
{
var httpHeader = new HttpHeader();
httpHeader["Location"] = "http://test.lidarr.audio/not-a-real-torrent.torrent";
httpHeader["Location"] = "http://test.readarr.audio/not-a-real-torrent.torrent";
Mocker.GetMock<IHttpClient>()
.Setup(s => s.Get(It.Is<HttpRequest>(h => h.Url.ToString() == _downloadUrl)))
@@ -332,7 +332,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
result.IsLocalhost.Should().BeTrue();
result.OutputRootFolders.Should().NotBeNull();
result.OutputRootFolders.First().Should().Be(@"C:\Downloads\Finished\utorrent\lidarr".AsOsAgnostic());
result.OutputRootFolders.First().Should().Be(@"C:\Downloads\Finished\utorrent\readarr".AsOsAgnostic());
}
[Test]
@@ -87,7 +87,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<ITransmissionProxy>()
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/Lidarr", It.IsAny<TransmissionSettings>()), Times.Once());
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/Readarr", It.IsAny<TransmissionSettings>()), Times.Once());
}
[Test]
@@ -103,7 +103,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<ITransmissionProxy>()
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/transmission/Lidarr", It.IsAny<TransmissionSettings>()), Times.Once());
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/transmission/Readarr", It.IsAny<TransmissionSettings>()), Times.Once());
}
[Test]
@@ -121,7 +121,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<ITransmissionProxy>()
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/transmission/Lidarr", It.IsAny<TransmissionSettings>()), Times.Once());
.Verify(v => v.AddTorrentFromData(It.IsAny<byte[]>(), @"C:/Downloads/Finished/transmission/Readarr", It.IsAny<TransmissionSettings>()), Times.Once());
}
[Test]
@@ -218,7 +218,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
{
GivenMusicCategory();
_downloading.DownloadDir = @"C:/Downloads/Finished/transmission/Lidarr";
_downloading.DownloadDir = @"C:/Downloads/Finished/transmission/Readarr";
GivenTorrents(new List<TransmissionTorrent>
{
@@ -237,7 +237,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
{
GivenTvDirectory();
_downloading.DownloadDir = @"C:/Downloads/Finished/Lidarr/subdir";
_downloading.DownloadDir = @"C:/Downloads/Finished/Readarr/subdir";
GivenTorrents(new List<TransmissionTorrent>
{