From de3bfb7c5ab03e527dca1be3ef4a664dce266db6 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 21 May 2023 19:05:18 +0300 Subject: [PATCH] Fix spelling "Use languages from Torznab/Newznab attributes if given" --- .../Aggregation/Aggregators/AggregateLanguages.cs | 1 - src/NzbDrone.Core/Indexers/IndexerBase.cs | 3 --- src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs | 8 ++++---- src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs | 8 ++++---- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/NzbDrone.Core/Download/Aggregation/Aggregators/AggregateLanguages.cs b/src/NzbDrone.Core/Download/Aggregation/Aggregators/AggregateLanguages.cs index bf74231f0..b180d9ed7 100644 --- a/src/NzbDrone.Core/Download/Aggregation/Aggregators/AggregateLanguages.cs +++ b/src/NzbDrone.Core/Download/Aggregation/Aggregators/AggregateLanguages.cs @@ -31,7 +31,6 @@ namespace NzbDrone.Core.Download.Aggregation.Aggregators { _logger.Debug("Unable to aggregate languages, using parsed values: {0}", string.Join(", ", languages.ToList())); - remoteEpisode.Languages = languages; remoteEpisode.Languages = releaseInfo != null && releaseInfo.Languages.Any() ? releaseInfo.Languages : languages; return remoteEpisode; diff --git a/src/NzbDrone.Core/Indexers/IndexerBase.cs b/src/NzbDrone.Core/Indexers/IndexerBase.cs index bda101274..91b3cb8f6 100644 --- a/src/NzbDrone.Core/Indexers/IndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/IndexerBase.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text.RegularExpressions; using FluentValidation.Results; using NLog; using NzbDrone.Common.Http; @@ -16,8 +15,6 @@ namespace NzbDrone.Core.Indexers public abstract class IndexerBase : IIndexer where TSettings : IIndexerSettings, new() { - private static readonly Regex MultiRegex = new (@"\b(?multi)\b", RegexOptions.Compiled | RegexOptions.IgnoreCase); - protected readonly IIndexerStatusService _indexerStatusService; protected readonly IConfigService _configService; protected readonly IParsingService _parsingService; diff --git a/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs b/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs index a2e48f2ec..7fa5b8a9d 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs @@ -105,16 +105,16 @@ namespace NzbDrone.Core.Indexers.Newznab protected override List GetLanguages(XElement item) { - var languges = TryGetMultipleNewznabAttributes(item, "language"); + var languages = TryGetMultipleNewznabAttributes(item, "language"); var results = new List(); // Try to find 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; diff --git a/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs b/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs index f1cb7f0cf..d5faf25b0 100644 --- a/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs +++ b/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs @@ -96,16 +96,16 @@ namespace NzbDrone.Core.Indexers.Torznab protected override List GetLanguages(XElement item) { - var languges = TryGetMultipleTorznabAttributes(item, "language"); + var languages = TryGetMultipleTorznabAttributes(item, "language"); var results = new List(); // Try to find 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;