Fixed: Remove accents from titles when looking for matching series

pull/3113/head
Mark McDowall 10 years ago
parent 2008b32018
commit 41ece422c9

@ -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;
}).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…
Cancel
Save