mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
Monitor and Process downloads separately
New: Queue remains up to date while importing file from remote file system Fixed: Failed downloads still in queue won't result in failed search
This commit is contained in:
@@ -4,6 +4,7 @@ using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
using NzbDrone.Core.Download.TrackedDownloads;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Profiles.Qualities;
|
||||
@@ -69,11 +70,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.Returns(new List<Queue.Queue>());
|
||||
}
|
||||
|
||||
private void GivenQueue(IEnumerable<RemoteAlbum> remoteAlbums)
|
||||
private void GivenQueue(IEnumerable<RemoteAlbum> remoteAlbums, TrackedDownloadState trackedDownloadState = TrackedDownloadState.Downloading)
|
||||
{
|
||||
var queue = remoteAlbums.Select(remoteAlbum => new Queue.Queue
|
||||
{
|
||||
RemoteAlbum = remoteAlbum
|
||||
RemoteAlbum = remoteAlbum,
|
||||
TrackedDownloadState = trackedDownloadState
|
||||
});
|
||||
|
||||
Mocker.GetMock<IQueueService>()
|
||||
@@ -308,5 +310,25 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
GivenQueue(new List<RemoteAlbum> { remoteAlbum });
|
||||
Subject.IsSatisfiedBy(_remoteAlbum, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_true_if_everything_is_the_same_for_failed_pending()
|
||||
{
|
||||
_artist.QualityProfile.Value.Cutoff = Quality.FLAC.Id;
|
||||
|
||||
var remoteAlbum = Builder<RemoteAlbum>.CreateNew()
|
||||
.With(r => r.Artist = _artist)
|
||||
.With(r => r.Albums = new List<Album> { _album })
|
||||
.With(r => r.ParsedAlbumInfo = new ParsedAlbumInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_008)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
|
||||
GivenQueue(new List<RemoteAlbum> { remoteAlbum }, TrackedDownloadState.DownloadFailedPending);
|
||||
|
||||
Subject.IsSatisfiedBy(_remoteAlbum, null).Accepted.Should().BeTrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user