diff --git a/Service/ChannelMatcher.cs b/Service/ChannelMatcher.cs index d3b47b4..3d5af17 100644 --- a/Service/ChannelMatcher.cs +++ b/Service/ChannelMatcher.cs @@ -19,9 +19,9 @@ public sealed class ChannelMatcher : IChannelMatcher static readonly IDictionary TextReplacements = new Dictionary { { "RUMANIA", "Romania" }, - { "^Romania[\"\\|:]", "RO:" }, + { "^[\\|\":]* *Romania *[\"\\|:]", "RO:" }, - { "^[\\|\":]*([A-Z][A-Z])[\\|\":] *", "$1:" }, + { "^[\\|\":]* *([A-Z][A-Z]) *[\\|\":] *", "$1:" }, { "^([A-Z][A-Z]): *(.*) \\1$", "$1: $2" }, { " HEVC$", "" }, diff --git a/UnitTests/Service/ChannelMatcherTests.cs b/UnitTests/Service/ChannelMatcherTests.cs index e96dfa0..8cc348f 100644 --- a/UnitTests/Service/ChannelMatcherTests.cs +++ b/UnitTests/Service/ChannelMatcherTests.cs @@ -26,6 +26,7 @@ public void SetUp() [TestCase("Digi Sport 2", "RO: Digi Sport 2", "RO: DIGI Sport 2")] [TestCase("Digi World", "RO: Digi World FHD", "RUMANIA: DigiWorld FHD (Opt-1)")] [TestCase("Golf Channel", "FR: Golf Channel", "|FR| GOLF CHANNEL FHD")] + [TestCase("MTV Europe", null, "RO: MTV Europe")] [TestCase("Realitatea Plus", null, "Realitatea Plus")] [TestCase("România TV", "România TV", "RO\" Romania TV")] [TestCase("Somax", "RO: Somax TV", "Somax TV")] @@ -72,8 +73,10 @@ public void DoesMatch_CompareWithDifferentValue_ReturnsFalse() [TestCase("|RO| Ardeal TV", "ARDEALTV")] [TestCase("|ROM|: Cromtel", "CROMTEL")] [TestCase("|UK| CHELSEA TV (Live On Matches) HD", "UKCHELSEATV")] + [TestCase("RO \" DIGI SPORT 1 HD RO", "DIGISPORT1")] [TestCase("RO: Animal World [768p]", "ANIMALWORLD")] [TestCase("RO: Bit TV (ROM)", "BITTV")] + [TestCase("RO: HBO 3 RO", "HBO3")] [TestCase("RO: HBO HD RO", "HBO")] [TestCase("RO: Nașul TV (New!)", "NASULTV")] [TestCase("RO: U TV S1-1", "UTV")]