mirror of
https://github.com/Readarr/Readarr
synced 2025-12-14 12:24:49 +01:00
Fixed: Minor Cleanup
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
ce1da8665f
commit
3e10c994df
2 changed files with 9 additions and 9 deletions
|
|
@ -33,10 +33,9 @@ public QueueSpecification(IQueueService queueService,
|
|||
public Decision IsSatisfiedBy(RemoteAlbum subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
var queue = _queueService.GetQueue();
|
||||
var matchingAlbum = queue.Where(q => q.RemoteAlbum != null &&
|
||||
q.RemoteAlbum.Artist != null &&
|
||||
q.RemoteAlbum.Artist.Id == subject.Artist.Id &&
|
||||
q.RemoteAlbum.Albums.Select(e => e.Id).Intersect(subject.Albums.Select(e => e.Id)).Any())
|
||||
var matchingAlbum = queue.Where(q => q.RemoteAlbum?.Artist != null &&
|
||||
q.RemoteAlbum.Artist.Id == subject.Artist.Id &&
|
||||
q.RemoteAlbum.Albums.Select(e => e.Id).Intersect(subject.Albums.Select(e => e.Id)).Any())
|
||||
.ToList();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,12 @@ public virtual Decision IsSatisfiedBy(RemoteAlbum subject, SearchCriteriaBase se
|
|||
if (mostRecent != null && mostRecent.EventType == HistoryEventType.Grabbed)
|
||||
{
|
||||
var recent = mostRecent.Date.After(DateTime.UtcNow.AddHours(-12));
|
||||
|
||||
if (!recent && cdhEnabled)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// The artist will be the same as the one in history since it's the same album.
|
||||
// Instead of fetching the artist from the DB reuse the known artist.
|
||||
var preferredWordScore = _preferredWordServiceCalculator.Calculate(subject.Artist, mostRecent.SourceTitle);
|
||||
|
|
@ -72,11 +78,6 @@ public virtual Decision IsSatisfiedBy(RemoteAlbum subject, SearchCriteriaBase se
|
|||
subject.ParsedAlbumInfo.Quality,
|
||||
subject.PreferredWordScore);
|
||||
|
||||
if (!recent && cdhEnabled)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!cutoffUnmet)
|
||||
{
|
||||
if (recent)
|
||||
|
|
|
|||
Loading…
Reference in a new issue