mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
Fixed: Sorting interactive search by quality for unknown movie results
Fixes #5026
This commit is contained in:
parent
30293bc7cc
commit
f33f004aa9
@ -11,6 +11,7 @@
|
||||
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 @@ public ReleaseModule(IFetchAndParseRss rssFetcherAndParser,
|
||||
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 @@ protected virtual ReleaseResource MapDecision(DownloadDecision decision, int ini
|
||||
|
||||
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.Download;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Profiles;
|
||||
|
||||
namespace Radarr.Api.V3.Indexers
|
||||
{
|
||||
@ -22,7 +23,9 @@ public class ReleasePushModule : ReleaseModuleBase
|
||||
public ReleasePushModule(IMakeDownloadDecision downloadDecisionMaker,
|
||||
IProcessDownloadDecisions downloadDecisionProcessor,
|
||||
IIndexerFactory indexerFactory,
|
||||
IProfileService qualityProfileService,
|
||||
Logger logger)
|
||||
: base(qualityProfileService)
|
||||
{
|
||||
_downloadDecisionMaker = downloadDecisionMaker;
|
||||
_downloadDecisionProcessor = downloadDecisionProcessor;
|
||||
|
Loading…
Reference in New Issue
Block a user