1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -04:00

Fixed all tests and even added some new ones :) (#835)

* First fixing of tests.

* Updated more tests.

* Fix some tests

* Fix all prioritization tests.

And add new for preferred words.

* Updated CompletedDownloadservice tests

* Fixed a lot of tests

* Fixed all indexer requests. We should add more for the indexers we added.

To lazy for that though ¯\_(ツ)_/¯

* Fixed organizer tests.

Should probably be also updated to incorporate our newly added tags.

* Fix notification tests.

* Fixed update test for osx

* Fixed a few more tests.

* Fixed some more tests.

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update activity.less

* Update appveyor.yml

* Update appveyor.yml

* Update CommonVersionInfo.cs

* Update build-appveyor.cake

Let's hope this works.

* Update CommonVersionInfo.cs

Just to kickstart appveyor

* Fixed a few tests

* Just ignore those tests.

* Fixed more tests.

* First steps in fixing Core.Test.Download.DownloadApprovedFixture

* Fix most DownloadApprovedFixture tests

* Fixed something.

* Fixed a few more tests.

* Fixed pending release tests.

* All Core tests are now fixed.

* Fixed the last tests :)

* Fixed Download Station Tests.

* Fixed Vuze and Transmission default settings which caused the tests to fail.

* Fix most tests.

* Fix RootFolder tests.

* Fixed last tests
This commit is contained in:
Leonardo Galli
2017-03-06 22:23:25 +01:00
committed by GitHub
parent 5bd008f468
commit 7cfa0531dc
74 changed files with 801 additions and 1094 deletions
@@ -254,37 +254,35 @@ namespace NzbDrone.Core.Download.Pending
return new[] { delay, minimumAge }.Max();
}
//private void RemoveGrabbed(RemoteEpisode remoteEpisode)
//{
// var pendingReleases = GetPendingReleases();
// var episodeIds = remoteEpisode.Episodes.Select(e => e.Id);
private void RemoveGrabbed(RemoteMovie remoteEpisode)
{
var pendingReleases = GetPendingReleases();
// var existingReports = pendingReleases.Where(r => r.RemoteEpisode.Episodes.Select(e => e.Id)
// .Intersect(episodeIds)
// .Any())
// .ToList();
var existingReports = pendingReleases.Where(r => r.RemoteMovie.Movie.Id == remoteEpisode.Movie.Id)
.ToList();
// if (existingReports.Empty())
// {
// return;
// }
if (existingReports.Empty())
{
return;
}
// var profile = remoteEpisode.Series.Profile.Value;
var profile = remoteEpisode.Movie.Profile.Value;
// foreach (var existingReport in existingReports)
// {
// var compare = new QualityModelComparer(profile).Compare(remoteEpisode.ParsedEpisodeInfo.Quality,
// existingReport.RemoteEpisode.ParsedEpisodeInfo.Quality);
foreach (var existingReport in existingReports)
{
var compare = new QualityModelComparer(profile).Compare(remoteEpisode.ParsedMovieInfo.Quality,
existingReport.RemoteMovie.ParsedMovieInfo.Quality);
// //Only remove lower/equal quality pending releases
// //It is safer to retry these releases on the next round than remove it and try to re-add it (if its still in the feed)
// if (compare >= 0)
// {
// _logger.Debug("Removing previously pending release, as it was grabbed.");
// Delete(existingReport);
// }
// }
//}
//Only remove lower/equal quality pending releases
//It is safer to retry these releases on the next round than remove it and try to re-add it (if its still in the feed)
if (compare >= 0)
{
_logger.Debug("Removing previously pending release, as it was grabbed.");
Delete(existingReport);
}
}
}
private void RemoveRejected(List<DownloadDecision> rejected)
{
@@ -332,7 +330,7 @@ namespace NzbDrone.Core.Download.Pending
public void Handle(MovieGrabbedEvent message)
{
//RemoveGrabbed(message.Movie);
RemoveGrabbed(message.Movie);
}
public void Handle(RssSyncCompleteEvent message)