Fixed: Correctly handle Repack Releases

This commit is contained in:
Qstick
2019-05-04 23:50:00 -04:00
parent 23316329ed
commit 2f1290d488
22 changed files with 673 additions and 72 deletions
@@ -1,7 +1,7 @@
using System.Linq;
using System.Collections.Generic;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Profiles.Delay;
using NzbDrone.Core.Languages;
namespace NzbDrone.Core.DecisionEngine
{
@@ -12,10 +12,12 @@ namespace NzbDrone.Core.DecisionEngine
public class DownloadDecisionPriorizationService : IPrioritizeDownloadDecision
{
private readonly IConfigService _configService;
private readonly IDelayProfileService _delayProfileService;
public DownloadDecisionPriorizationService(IDelayProfileService delayProfileService)
public DownloadDecisionPriorizationService(IConfigService configService, IDelayProfileService delayProfileService)
{
_configService = configService;
_delayProfileService = delayProfileService;
}
@@ -24,7 +26,7 @@ namespace NzbDrone.Core.DecisionEngine
return decisions.Where(c => c.RemoteAlbum.DownloadAllowed)
.GroupBy(c => c.RemoteAlbum.Artist.Id, (artistId, downloadDecisions) =>
{
return downloadDecisions.OrderByDescending(decision => decision, new DownloadDecisionComparer(_delayProfileService));
return downloadDecisions.OrderByDescending(decision => decision, new DownloadDecisionComparer(_configService, _delayProfileService));
})
.SelectMany(c => c)
.Union(decisions.Where(c => !c.RemoteAlbum.DownloadAllowed))