mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Fixed: Languages not showing up correctly.
This commit is contained in:
parent
b7e35fada8
commit
b865103871
@ -1,5 +1,6 @@
|
||||
using NLog;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
@ -19,12 +20,12 @@ public virtual Decision IsSatisfiedBy(RemoteMovie subject, SearchCriteriaBase se
|
||||
{
|
||||
var wantedLanguage = subject.Movie.Profile.Value.Language;
|
||||
|
||||
_logger.Debug("Checking if report meets language requirements. {0}", subject.ParsedMovieInfo.Languages);
|
||||
_logger.Debug("Checking if report meets language requirements. {0}", subject.ParsedMovieInfo.Languages.ToExtendedString());
|
||||
|
||||
if (!subject.ParsedMovieInfo.Languages.Contains(wantedLanguage))
|
||||
{
|
||||
_logger.Debug("Report Language: {0} rejected because it is not wanted, wanted {1}", subject.ParsedMovieInfo.Languages, wantedLanguage);
|
||||
return Decision.Reject("{0} is wanted, but found {1}", wantedLanguage, subject.ParsedMovieInfo.Languages);
|
||||
_logger.Debug("Report Language: {0} rejected because it is not wanted, wanted {1}", subject.ParsedMovieInfo.Languages.ToExtendedString(), wantedLanguage);
|
||||
return Decision.Reject("{0} is wanted, but found {1}", wantedLanguage, subject.ParsedMovieInfo.Languages.ToExtendedString());
|
||||
}
|
||||
|
||||
return Decision.Accept();
|
||||
|
@ -1,4 +1,7 @@
|
||||
namespace NzbDrone.Core.Parser
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace NzbDrone.Core.Parser
|
||||
{
|
||||
public enum Language
|
||||
{
|
||||
@ -27,4 +30,12 @@ public enum Language
|
||||
Hungarian = 22,
|
||||
Hebrew = 23
|
||||
}
|
||||
|
||||
public static class LanguageExtensions
|
||||
{
|
||||
public static string ToExtendedString(this IEnumerable<Language> languages)
|
||||
{
|
||||
return string.Join(", ", languages.Select(l => l.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ public static ParsedMovieInfo ParseMinimalMovieTitle(string title, string foundT
|
||||
var languageTitle = Regex.Replace(title.Replace(".", " "), foundTitle, "A Movie", RegexOptions.IgnoreCase);
|
||||
|
||||
result.Languages = LanguageParser.ParseLanguages(title);
|
||||
Logger.Debug("Language parsed: {0}", result.Languages);
|
||||
Logger.Debug("Language parsed: {0}", result.Languages.ToExtendedString());
|
||||
|
||||
result.Quality = QualityParser.ParseQuality(title);
|
||||
Logger.Debug("Quality parsed: {0}", result.Quality);
|
||||
|
@ -79,7 +79,7 @@ public ParsedMovieInfo ParseMovieInfo(string title, List<object> helpers)
|
||||
private ParsedMovieInfo EnhanceMinimalInfo(ParsedMovieInfo minimalInfo, List<object> helpers)
|
||||
{
|
||||
minimalInfo.Languages = LanguageParser.ParseLanguages(minimalInfo.SimpleReleaseTitle);
|
||||
_logger.Debug("Language(s) parsed: {0}", string.Join(", ", minimalInfo.Languages));
|
||||
_logger.Debug("Language(s) parsed: {0}", string.Join(", ", minimalInfo.Languages.ToExtendedString()));
|
||||
|
||||
minimalInfo.Quality = QualityParser.ParseQuality(minimalInfo.SimpleReleaseTitle);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user