Fixed: Sorting interactive search by quality for unknown movie results

Fixes #5026
pull/5848/head
Qstick 4 years ago
parent 30293bc7cc
commit f33f004aa9

@ -11,6 +11,7 @@ using NzbDrone.Core.Indexers;
using NzbDrone.Core.IndexerSearch;
using NzbDrone.Core.Movies;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Profiles;
using NzbDrone.Core.Validation;
using HttpStatusCode = System.Net.HttpStatusCode;
@ -35,7 +36,9 @@ namespace Radarr.Api.V3.Indexers
IDownloadService downloadService,
IMovieService movieService,
ICacheManager cacheManager,
IProfileService qualityProfileService,
Logger logger)
: base(qualityProfileService)
{
_rssFetcherAndParser = rssFetcherAndParser;
_nzbSearchService = nzbSearchService;

@ -1,11 +1,19 @@
using System.Collections.Generic;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Profiles;
using Radarr.Http;
namespace Radarr.Api.V3.Indexers
{
public abstract class ReleaseModuleBase : RadarrRestModule<ReleaseResource>
{
private readonly Profile _qualityProfie;
public ReleaseModuleBase(IProfileService qualityProfileService)
{
_qualityProfie = qualityProfileService.GetDefaultProfile(string.Empty);
}
protected virtual List<ReleaseResource> MapDecisions(IEnumerable<DownloadDecision> decisions)
{
var result = new List<ReleaseResource>();
@ -26,11 +34,7 @@ namespace Radarr.Api.V3.Indexers
release.ReleaseWeight = initialWeight;
if (decision.RemoteMovie.Movie != null)
{
release.QualityWeight = decision.RemoteMovie.Movie
.Profile.GetIndex(release.Quality.Quality).Index * 100;
}
release.QualityWeight = _qualityProfie.GetIndex(release.Quality.Quality).Index * 100;
release.QualityWeight += release.Quality.Revision.Real * 10;
release.QualityWeight += release.Quality.Revision.Version;

@ -9,6 +9,7 @@ using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Download;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Profiles;
namespace Radarr.Api.V3.Indexers
{
@ -22,7 +23,9 @@ namespace Radarr.Api.V3.Indexers
public ReleasePushModule(IMakeDownloadDecision downloadDecisionMaker,
IProcessDownloadDecisions downloadDecisionProcessor,
IIndexerFactory indexerFactory,
IProfileService qualityProfileService,
Logger logger)
: base(qualityProfileService)
{
_downloadDecisionMaker = downloadDecisionMaker;
_downloadDecisionProcessor = downloadDecisionProcessor;

Loading…
Cancel
Save