Fixed: Remove accents from titles when looking for matching series

This commit is contained in:
Mark McDowall 2014-08-11 07:19:02 -07:00
parent 2008b32018
commit 41ece422c9
3 changed files with 14 additions and 6 deletions

View File

@ -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");
}
}
}

View File

@ -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;
}).Distinct();
foreach (var sceneSeasonEpisodes in sceneSeasonGroups)

View File

@ -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)