mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-30 19:56:54 +00:00
Fixed: Remove accents from titles when looking for matching series
This commit is contained in:
parent
2008b32018
commit
41ece422c9
3 changed files with 14 additions and 6 deletions
|
@ -40,5 +40,13 @@ namespace NzbDrone.Core.Test.ParserTests
|
|||
var result = Parser.Parser.ParseSeriesName(postTitle);
|
||||
result.Should().Be(title.CleanSeriesTitle());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_remove_accents_from_title()
|
||||
{
|
||||
const String title = "Carnivŕle";
|
||||
|
||||
title.CleanSeriesTitle().Should().Be("carnivale");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Threading.Tasks;
|
||||
using NLog;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Core.DataAugmentation.Scene;
|
||||
using NzbDrone.Core.DecisionEngine;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Instrumentation.Extensions;
|
||||
|
@ -109,9 +106,12 @@ namespace NzbDrone.Core.IndexerSearch
|
|||
var sceneSeasonGroups = episodes.GroupBy(v =>
|
||||
{
|
||||
if (v.SceneSeasonNumber == 0 && v.SceneEpisodeNumber == 0)
|
||||
{
|
||||
return v.SeasonNumber;
|
||||
else
|
||||
return v.SceneSeasonNumber;
|
||||
}
|
||||
|
||||
return v.SceneSeasonNumber;
|
||||
|
||||
}).Distinct();
|
||||
|
||||
foreach (var sceneSeasonEpisodes in sceneSeasonGroups)
|
||||
|
|
|
@ -300,7 +300,7 @@ namespace NzbDrone.Core.Parser
|
|||
if (Int64.TryParse(title, out number))
|
||||
return title;
|
||||
|
||||
return NormalizeRegex.Replace(title, String.Empty).ToLower();
|
||||
return NormalizeRegex.Replace(title, String.Empty).ToLower().RemoveAccent();
|
||||
}
|
||||
|
||||
public static string CleanupEpisodeTitle(string title)
|
||||
|
|
Loading…
Reference in a new issue