From f165240df8cd982254cd28d4c1ac551193f8162b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mlendea=2C=20Hora=C8=9Biu?= Date: Sun, 9 Feb 2020 11:35:42 +0200 Subject: [PATCH] Improved some channel matching rules --- Service/ChannelMatcher.cs | 4 ++-- UnitTests/Service/ChannelMatcherTests.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Service/ChannelMatcher.cs b/Service/ChannelMatcher.cs index 3d5af17..6131b97 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 8cc348f..6a8fbac 100644 --- a/UnitTests/Service/ChannelMatcherTests.cs +++ b/UnitTests/Service/ChannelMatcherTests.cs @@ -74,6 +74,7 @@ public void DoesMatch_CompareWithDifferentValue_ReturnsFalse() [TestCase("|ROM|: Cromtel", "CROMTEL")] [TestCase("|UK| CHELSEA TV (Live On Matches) HD", "UKCHELSEATV")] [TestCase("RO \" DIGI SPORT 1 HD RO", "DIGISPORT1")] + [TestCase("RO-Animal Planet HD", "ANIMALPLANET")] [TestCase("RO: Animal World [768p]", "ANIMALWORLD")] [TestCase("RO: Bit TV (ROM)", "BITTV")] [TestCase("RO: HBO 3 RO", "HBO3")]