mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-24 22:35:39 -04:00
Changed: Remove Language Profiles (#870)
* Changed: Remove Language Profiles * fixup! Changed: Remove Language Profiles * fixup! Changed: Remove Language Profiles * Remove unused method in FileNameBuilder * Fixed: Cleanup Int Converter Copy/Paste Issues and Grammar
This commit is contained in:
@@ -6,7 +6,6 @@ using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Profiles.Delay;
|
||||
using NzbDrone.Core.Qualities;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Languages;
|
||||
using NzbDrone.Core.Profiles.Releases;
|
||||
|
||||
namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
|
||||
@@ -47,7 +46,6 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
|
||||
}
|
||||
|
||||
var qualityProfile = subject.Artist.QualityProfile.Value;
|
||||
var languageProfile = subject.Artist.LanguageProfile.Value;
|
||||
var delayProfile = _delayProfileService.BestForTags(subject.Artist.Tags);
|
||||
var delay = delayProfile.GetProtocolDelay(subject.Release.DownloadProtocol);
|
||||
var isPreferredProtocol = subject.Release.DownloadProtocol == delayProfile.PreferredProtocol;
|
||||
@@ -59,7 +57,6 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
|
||||
}
|
||||
|
||||
var qualityComparer = new QualityModelComparer(qualityProfile);
|
||||
var languageComparer = new LanguageComparer(languageProfile);
|
||||
|
||||
if (isPreferredProtocol)
|
||||
{
|
||||
@@ -70,15 +67,11 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
|
||||
if (trackFiles.Any())
|
||||
{
|
||||
var currentQualities = trackFiles.Select(c => c.Quality).Distinct().ToList();
|
||||
var currentLanguages = trackFiles.Select(c => c.Language).Distinct().ToList();
|
||||
|
||||
var upgradable = _upgradableSpecification.IsUpgradable(qualityProfile,
|
||||
languageProfile,
|
||||
currentQualities,
|
||||
currentLanguages,
|
||||
_preferredWordServiceCalculator.Calculate(subject.Artist, trackFiles[0].GetSceneOrFileName()),
|
||||
subject.ParsedAlbumInfo.Quality,
|
||||
subject.ParsedAlbumInfo.Language,
|
||||
subject.PreferredWordScore);
|
||||
if (upgradable)
|
||||
{
|
||||
@@ -92,11 +85,10 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
|
||||
// If quality meets or exceeds the best allowed quality in the profile accept it immediately
|
||||
var bestQualityInProfile = qualityProfile.LastAllowedQuality();
|
||||
var isBestInProfile = qualityComparer.Compare(subject.ParsedAlbumInfo.Quality.Quality, bestQualityInProfile) >= 0;
|
||||
var isBestInProfileLanguage = languageComparer.Compare(subject.ParsedAlbumInfo.Language, languageProfile.LastAllowedLanguage()) >= 0;
|
||||
|
||||
if (isBestInProfile && isBestInProfileLanguage && isPreferredProtocol)
|
||||
if (isBestInProfile && isPreferredProtocol)
|
||||
{
|
||||
_logger.Debug("Quality and language is highest in profile for preferred protocol, will not delay");
|
||||
_logger.Debug("Quality is highest in profile for preferred protocol, will not delay");
|
||||
return Decision.Accept();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.History;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Languages;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Profiles.Releases;
|
||||
using NzbDrone.Core.Qualities;
|
||||
@@ -61,21 +60,16 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
|
||||
|
||||
var cutoffUnmet = _upgradableSpecification.CutoffNotMet(
|
||||
subject.Artist.QualityProfile,
|
||||
subject.Artist.LanguageProfile,
|
||||
new List<QualityModel> { mostRecent.Quality },
|
||||
new List<Language> { mostRecent.Language },
|
||||
preferredWordScore,
|
||||
subject.ParsedAlbumInfo.Quality,
|
||||
subject.PreferredWordScore);
|
||||
|
||||
var upgradeable = _upgradableSpecification.IsUpgradable(
|
||||
subject.Artist.QualityProfile,
|
||||
subject.Artist.LanguageProfile,
|
||||
new List<QualityModel> { mostRecent.Quality },
|
||||
new List<Language> { mostRecent.Language },
|
||||
preferredWordScore,
|
||||
subject.ParsedAlbumInfo.Quality,
|
||||
subject.ParsedAlbumInfo.Language,
|
||||
subject.PreferredWordScore);
|
||||
|
||||
if (!recent && cdhEnabled)
|
||||
|
||||
Reference in New Issue
Block a user