|
|
|
@ -129,13 +129,6 @@ namespace NzbDrone.Core.Download.Pending
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ILookup<int, PendingRelease> CreateBookLookup(IEnumerable<PendingRelease> alreadyPending)
|
|
|
|
|
{
|
|
|
|
|
return alreadyPending.SelectMany(v => v.RemoteBook.Books
|
|
|
|
|
.Select(d => new { Book = d, PendingRelease = v }))
|
|
|
|
|
.ToLookup(v => v.Book.Id, v => v.PendingRelease);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<ReleaseInfo> GetPending()
|
|
|
|
|
{
|
|
|
|
|
var releases = _repository.All().Select(p => p.Release).ToList();
|
|
|
|
@ -148,13 +141,6 @@ namespace NzbDrone.Core.Download.Pending
|
|
|
|
|
return releases;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<ReleaseInfo> FilterBlockedIndexers(List<ReleaseInfo> releases)
|
|
|
|
|
{
|
|
|
|
|
var blockedIndexers = new HashSet<int>(_indexerStatusService.GetBlockedProviders().Select(v => v.ProviderId));
|
|
|
|
|
|
|
|
|
|
return releases.Where(release => !blockedIndexers.Contains(release.IndexerId)).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<RemoteBook> GetPendingRemoteBooks(int authorId)
|
|
|
|
|
{
|
|
|
|
|
return IncludeRemoteBooks(_repository.AllByAuthorId(authorId)).Select(v => v.RemoteBook).ToList();
|
|
|
|
@ -249,6 +235,20 @@ namespace NzbDrone.Core.Download.Pending
|
|
|
|
|
.FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ILookup<int, PendingRelease> CreateBookLookup(IEnumerable<PendingRelease> alreadyPending)
|
|
|
|
|
{
|
|
|
|
|
return alreadyPending.SelectMany(v => v.RemoteBook.Books
|
|
|
|
|
.Select(d => new { Book = d, PendingRelease = v }))
|
|
|
|
|
.ToLookup(v => v.Book.Id, v => v.PendingRelease);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<ReleaseInfo> FilterBlockedIndexers(List<ReleaseInfo> releases)
|
|
|
|
|
{
|
|
|
|
|
var blockedIndexers = new HashSet<int>(_indexerStatusService.GetBlockedProviders().Select(v => v.ProviderId));
|
|
|
|
|
|
|
|
|
|
return releases.Where(release => !blockedIndexers.Contains(release.IndexerId)).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<PendingRelease> GetPendingReleases()
|
|
|
|
|
{
|
|
|
|
|
return IncludeRemoteBooks(_repository.All().ToList());
|
|
|
|
@ -338,13 +338,6 @@ namespace NzbDrone.Core.Download.Pending
|
|
|
|
|
_eventAggregator.PublishEvent(new PendingReleasesUpdatedEvent());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static Func<PendingRelease, bool> MatchingReleasePredicate(ReleaseInfo release)
|
|
|
|
|
{
|
|
|
|
|
return p => p.Title == release.Title &&
|
|
|
|
|
p.Release.PublishDate == release.PublishDate &&
|
|
|
|
|
p.Release.Indexer == release.Indexer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int GetDelay(RemoteBook remoteBook)
|
|
|
|
|
{
|
|
|
|
|
var delayProfile = _delayProfileService.AllForTags(remoteBook.Author.Tags).OrderBy(d => d.Order).First();
|
|
|
|
@ -439,5 +432,12 @@ namespace NzbDrone.Core.Download.Pending
|
|
|
|
|
{
|
|
|
|
|
RemoveRejected(message.ProcessedDecisions.Rejected);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static Func<PendingRelease, bool> MatchingReleasePredicate(ReleaseInfo release)
|
|
|
|
|
{
|
|
|
|
|
return p => p.Title == release.Title &&
|
|
|
|
|
p.Release.PublishDate == release.PublishDate &&
|
|
|
|
|
p.Release.Indexer == release.Indexer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|