mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
Implement Release Parsing, Decision Engine, and Downloading (#35)
* Implement Parsing, Decision Engine, and Downloading
This commit is contained in:
@@ -9,6 +9,7 @@ using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Tv;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.RemotePathMappings;
|
||||
@@ -30,8 +31,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests
|
||||
.Returns(30);
|
||||
|
||||
Mocker.GetMock<IParsingService>()
|
||||
.Setup(s => s.Map(It.IsAny<ParsedEpisodeInfo>(), It.IsAny<int>(), It.IsAny<int>(), (SearchCriteriaBase)null))
|
||||
.Returns(() => CreateRemoteEpisode());
|
||||
.Setup(s => s.Map(It.IsAny<ParsedAlbumInfo>(), (SearchCriteriaBase)null))
|
||||
.Returns(() => CreateRemoteAlbum());
|
||||
|
||||
Mocker.GetMock<IHttpClient>()
|
||||
.Setup(s => s.Get(It.IsAny<HttpRequest>()))
|
||||
@@ -42,22 +43,21 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests
|
||||
.Returns<string, OsPath>((h, r) => r);
|
||||
}
|
||||
|
||||
protected virtual RemoteEpisode CreateRemoteEpisode()
|
||||
protected virtual RemoteAlbum CreateRemoteAlbum()
|
||||
{
|
||||
var remoteEpisode = new RemoteEpisode();
|
||||
remoteEpisode.Release = new ReleaseInfo();
|
||||
remoteEpisode.Release.Title = _title;
|
||||
remoteEpisode.Release.DownloadUrl = _downloadUrl;
|
||||
remoteEpisode.Release.DownloadProtocol = Subject.Protocol;
|
||||
var remoteAlbum = new RemoteAlbum();
|
||||
remoteAlbum.Release = new ReleaseInfo();
|
||||
remoteAlbum.Release.Title = _title;
|
||||
remoteAlbum.Release.DownloadUrl = _downloadUrl;
|
||||
remoteAlbum.Release.DownloadProtocol = Subject.Protocol;
|
||||
|
||||
remoteEpisode.ParsedEpisodeInfo = new ParsedEpisodeInfo();
|
||||
remoteEpisode.ParsedEpisodeInfo.FullSeason = false;
|
||||
remoteAlbum.ParsedAlbumInfo = new ParsedAlbumInfo();
|
||||
|
||||
remoteEpisode.Episodes = new List<Episode>();
|
||||
remoteAlbum.Albums = new List<Album>();
|
||||
|
||||
remoteEpisode.Series = new Series();
|
||||
remoteAlbum.Artist = new Artist();
|
||||
|
||||
return remoteEpisode;
|
||||
return remoteAlbum;
|
||||
}
|
||||
|
||||
protected void VerifyIdentifiable(DownloadClientItem downloadClientItem)
|
||||
|
||||
Reference in New Issue
Block a user