diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index d5783d5..d64da73 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl liberapay: HMlendea issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username -custom: ['https://www.paypal.com/donate?hosted_button_id=6YVRGJHDGWGKQ','https://liberapay.com/HMlendea/donate'] +custom: ['https://www.paypal.com/donate?hosted_button_id=6YVRGJHDGWGKQ'] diff --git a/Data/channels.xml b/Data/channels.xml index 12a544f..e5d880b 100644 --- a/Data/channels.xml +++ b/Data/channels.xml @@ -607,6 +607,9 @@ RO kids https://raw.githubusercontent.com/hmlendea/tv-logos/master/logos/cartoon_network.png + + RO: Cartoon + CBSReality.ro @@ -1581,6 +1584,7 @@ RO: H!T RO: Hit Ch RO: Hit Channel + RO: Hit Music Channel RO: Hit Music RO: Hit @@ -2470,6 +2474,7 @@ RO: Nat Geographic RO: NG RO: NGC + RO: NGRO @@ -2992,6 +2997,7 @@ https://raw.githubusercontent.com/hmlendea/tv-logos/master/logos/realitatea_plus.png RO: Realitatea Plus TV + RO: Realitatea TV Plus @@ -3825,6 +3831,7 @@ local-muntenia https://raw.githubusercontent.com/hmlendea/tv-logos/master/logos/valea_prahovei_tv.png + RO: VP RO: VPTV VP HD diff --git a/Service/ChannelMatcher.cs b/Service/ChannelMatcher.cs index 4c23e72..c2f7268 100644 --- a/Service/ChannelMatcher.cs +++ b/Service/ChannelMatcher.cs @@ -18,10 +18,8 @@ public sealed class ChannelMatcher : IChannelMatcher static readonly IDictionary TextReplacements = new Dictionary { - { "\\[B\\]", "" }, - - { "[\\(\\[]]*([Aa]uto|[Bb]ackup|[Ll]ive [Oo]n [Mm]atches|[Mm]ulti-*[Aa]udio|[Mm]ulti-*[Ss]ub|[Nn]ew!*|[Oo]n-[Dd]emand)[\\)\\]]*", "" }, - { "([a-zA-Z0-9_ ]{4})[ _\\|\\[\\(\\]\\)\".:-](Ultra|[FU])*_*[HMS][DQ]", "$1" }, + { "[\\(\\[]]*([Aa]uto|[Bb]|[Bb]ackup|[Ll]ive [Oo]n [Mm]atches|[Mm]ulti-*[Aa]udio|[Mm]ulti-*[Ss]ub|[Nn]ew!*|[Oo]n-[Dd]emand)[\\)\\]]*", "" }, + { "(.)[ \\.:_\\-\\|\\[\\(\\]\\)\"]+(Ultra|Full|[FU])*[_-]*[HMS][DQ]", "$1" }, { "4[Kk]\\+", "" }, { "RO\\(L\\) *[\\|\\[\\(\\]\\)\".:-]", "RO:" }, diff --git a/UnitTests/Service/ChannelMatcherTests.cs b/UnitTests/Service/ChannelMatcherTests.cs index 21d4816..e65db46 100644 --- a/UnitTests/Service/ChannelMatcherTests.cs +++ b/UnitTests/Service/ChannelMatcherTests.cs @@ -50,7 +50,10 @@ public void ChannelNamesDoMatch_WithAliasWithCountry( [TestCase("Digi World", "RO: Digi World FHD", "RUMANIA: DigiWorld FHD (Opt-1)")] [TestCase("Duna", "RO: Duna TV", "RO | Duna Tv")] [TestCase("Golf Channel", "FR: Golf Channel", "|FR| GOLF CHANNEL FHD")] + [TestCase("H!T Music Channel", "RO: Hit Music Channel", "RO: Hit Music Channel")] + [TestCase("H!T Music Channel", "RO: Hit Music Channel", "RO(L): HIT MUSIC CHANNEL SD")] [TestCase("H!T Music Channel", "RO: Hit", "RO | HIT")] + [TestCase("HBO 1", "RO: HBO", "RO:HBO HD")] [TestCase("HD Net Van Damme", "HD NET Jean Claude Van Damme", "HD NET Jean Claude van Damme")] [TestCase("Hora TV", "RO: Hora TV", "RO(L): HORA TV SD")] [TestCase("Jurnal TV", "MD: Jurnal TV", "Jurnal TV Moldavia")] @@ -58,6 +61,7 @@ public void ChannelNamesDoMatch_WithAliasWithCountry( [TestCase("NCN TV", "RO: NCN", "RO: NCN HD")] [TestCase("Pro TV News", "RO: Pro News", "Pro News")] [TestCase("Publika TV", "MD: Publika", "PUBLIKA_TV_HD")] + [TestCase("Realitatea Plus", "RO: Realitatea TV Plus", "RO(L): REALITATEA TV PLUS SD")] [TestCase("România TV", "România TV", "RO\" Romania TV")] [TestCase("Somax", "RO: Somax TV", "Somax TV")] [TestCase("Sundance", "RO: Sundance TV", "RO: Sundance TV FHD (MultiSub)")] @@ -83,6 +87,7 @@ public void ChannelNamesDoMatch_WithAliasWithoutCountry( [TestCase("AMC", "RO: AMC Romania")] [TestCase("Antena 3", "Antena 3 Ultra_HD")] + [TestCase("Elita TV", "Elita TV")] [TestCase("HBO 3", "HBO 3 F_HD")] [TestCase("MTV Europe", "RO: MTV Europe")] [TestCase("Pro TV", "PRO TV ULTRA_HD")] @@ -147,7 +152,7 @@ public void ChannelNamesDoNotMatch_WithoutAliasWithoutCountry( [TestCase("TVC21", "MD", "MDTVC21")] [TestCase("TVR Moldova", "MD", "MDTVR")] [TestCase("TVR Târgu Mureș", "RO", "TVRTARGUMURES")] - [TestCase("VP HD", "RO", "VPHD")] + [TestCase("VP HD", "RO", "VP")] [TestCase("VSV De Niro", "RO", "VSVDENIRO")] [Test] public void NormaliseName_WithCountry_ReturnsExpectedValue(string name, string country, string expectedNormalisedName) @@ -164,6 +169,7 @@ public void NormaliseName_WithCountry_ReturnsExpectedValue(string name, string c [TestCase("|ROM|: Cromtel", "CROMTEL")] [TestCase("|UK| CHELSEA TV (Live On Matches) HD", "UKCHELSEATV")] [TestCase("Canal Regional (Moldova)", "MDCANALREGIONAL")] + [TestCase("Cartoon Network FullHD", "CARTOONNETWORK")] [TestCase("Digi 4K", "DIGI4K")] [TestCase("DIGI SPORT 4 (RO)", "DIGISPORT4")] [TestCase("Jurnal TV Moldova", "MDJURNALTV")] @@ -173,17 +179,19 @@ public void NormaliseName_WithCountry_ReturnsExpectedValue(string name, string c [TestCase("MD: MD| Pro TV Chișinău.", "MDPROTVCHISINAU")] [TestCase("MD: ProTV Chisinau", "MDPROTVCHISINAU")] [TestCase("MINIMAX ROMANIA HD", "MINIMAXROMANIA")] + [TestCase("Pro Cinema Full-HD", "PROCINEMA")] [TestCase("Pro TV [B] RO", "PROTV")] [TestCase("PUBLIKA_TV_HD", "PUBLIKATV")] [TestCase("RO \" DIGI SPORT 1 HD RO", "DIGISPORT1")] [TestCase("RO | Travel", "TRAVEL")] [TestCase("RO-Animal Planet HD", "ANIMALPLANET")] - [TestCase("Ro: 1 HD", "1HD")] + [TestCase("RO: 1HD", "1HD")] [TestCase("RO: Animal World [768p]", "ANIMALWORLD")] [TestCase("RO: Bit TV (ROM)", "BITTV")] [TestCase("RO: Digi24 (România)", "DIGI24")] [TestCase("RO: HBO 3 RO", "HBO3")] [TestCase("RO: HBO HD RO", "HBO")] + [TestCase("RO: MiniMax-HD", "MINIMAX")] [TestCase("RO: Nașul TV (New!)", "NASULTV")] [TestCase("RO: Nickelodeon (RO)", "NICKELODEON")] [TestCase("Ro: Pro TV backup", "PROTV")] @@ -191,24 +199,34 @@ public void NormaliseName_WithCountry_ReturnsExpectedValue(string name, string c [TestCase("RO: Tele Moldova", "TELEMOLDOVA")] [TestCase("RO: Travel", "TRAVEL")] [TestCase("RO: TVR Moldova", "TVRMOLDOVA")] + [TestCase("RO: U TV [b]", "UTV")] + [TestCase("RO: U TV [B]", "UTV")] [TestCase("RO: U TV S1-1", "UTV")] + [TestCase("RO:HBO HD", "HBO")] [TestCase("RO.| DIGI 24", "DIGI24")] [TestCase("RO(L): E! ENTERTAINMENT FHD", "EENTERTAINMENT")] + [TestCase("RO(L): HIT MUSIC CHANNEL SD", "HITMUSICCHANNEL")] + [TestCase("RO(L): IASI TV SD", "IASITV")] + [TestCase("RO(L): KronehitTV FHD", "KRONEHITTV")] + [TestCase("RO(L): REALITATEA TV PLUS SD", "REALITATEATVPLUS")] + [TestCase("RO(L): VP SD", "VP")] [TestCase("RO\" Romania TV", "ROMANIATV")] [TestCase("RO| Antena 3 4K+", "ANTENA3")] [TestCase("RO| CINEMA RO.", "CINEMARO")] [TestCase("RO| Digi Life 4K+", "DIGILIFE")] + [TestCase("RO| NGRO", "NGRO")] [TestCase("RO| TARAF:HD", "TARAF")] [TestCase("RO|DISOVERY_SCIENCE_HD", "DISOVERYSCIENCE")] [TestCase("RTR Moldova HD", "MDRTR")] [TestCase("RUMANIA: DigiWorld FHD (Opt-1)", "DIGIWORLD")] [TestCase("TV 8 HD (Auto)", "TV8")] - [TestCase("TV 8 Moldova HD", "MDTV8")] + [TestCase("TV 8 Moldova HD", "MDTV8")] [TestCase("TV Centrală Moldova", "MDTVCENTRALA")] [TestCase("TVR 1 (Backup) RO", "TVR1")] [TestCase("TVR2 [B] RO", "TVR2")] [TestCase("U TV", "UTV")] [TestCase("US: NASA TV US", "USNASATV")] + [TestCase("Viasat Explore Full_HD", "VIASATEXPLORE")] [TestCase("VIP|RO|: Discovery Channel FHD", "DISCOVERYCHANNEL")] [TestCase("VSV Robert de Niro HD", "VSVROBERTDENIRO")] [TestCase("VSV Robert de Niro", "VSVROBERTDENIRO")]