Fix spelling "Use languages from Torznab/Newznab attributes if given"

(cherry picked from commit de3bfb7c5ab03e527dca1be3ef4a664dce266db6)

Fixes #2526
pull/2538/head
Bogdan 2 years ago
parent 1307f8f5b1
commit 8ddff3868d

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions;
using FluentValidation.Results; using FluentValidation.Results;
using NLog; using NLog;
using NzbDrone.Common.Http; using NzbDrone.Common.Http;
@ -16,8 +15,6 @@ namespace NzbDrone.Core.Indexers
public abstract class IndexerBase<TSettings> : IIndexer public abstract class IndexerBase<TSettings> : IIndexer
where TSettings : IIndexerSettings, new() where TSettings : IIndexerSettings, new()
{ {
private static readonly Regex MultiRegex = new (@"\b(?<multi>multi)\b", RegexOptions.Compiled | RegexOptions.IgnoreCase);
protected readonly IIndexerStatusService _indexerStatusService; protected readonly IIndexerStatusService _indexerStatusService;
protected readonly IConfigService _configService; protected readonly IConfigService _configService;
protected readonly IParsingService _parsingService; protected readonly IParsingService _parsingService;

@ -105,16 +105,16 @@ namespace NzbDrone.Core.Indexers.Newznab
protected override List<Language> GetLanguages(XElement item) protected override List<Language> GetLanguages(XElement item)
{ {
var languges = TryGetMultipleNewznabAttributes(item, "language"); var languages = TryGetMultipleNewznabAttributes(item, "language");
var results = new List<Language>(); var results = new List<Language>();
// Try to find <language> elements for some indexers that suck at following the rules. // Try to find <language> elements for some indexers that suck at following the rules.
if (languges.Count == 0) if (languages.Count == 0)
{ {
languges = item.Elements("language").Select(e => e.Value).ToList(); languages = item.Elements("language").Select(e => e.Value).ToList();
} }
foreach (var language in languges) foreach (var language in languages)
{ {
var mappedLanguage = IsoLanguages.FindByName(language)?.Language ?? null; var mappedLanguage = IsoLanguages.FindByName(language)?.Language ?? null;

@ -86,16 +86,16 @@ namespace NzbDrone.Core.Indexers.Torznab
protected override List<Language> GetLanguages(XElement item) protected override List<Language> GetLanguages(XElement item)
{ {
var languges = TryGetMultipleTorznabAttributes(item, "language"); var languages = TryGetMultipleTorznabAttributes(item, "language");
var results = new List<Language>(); var results = new List<Language>();
// Try to find <language> elements for some indexers that suck at following the rules. // Try to find <language> elements for some indexers that suck at following the rules.
if (languges.Count == 0) if (languages.Count == 0)
{ {
languges = item.Elements("language").Select(e => e.Value).ToList(); languages = item.Elements("language").Select(e => e.Value).ToList();
} }
foreach (var language in languges) foreach (var language in languages)
{ {
var mappedLanguage = IsoLanguages.FindByName(language)?.Language ?? null; var mappedLanguage = IsoLanguages.FindByName(language)?.Language ?? null;

Loading…
Cancel
Save