diff options
author | Matti Lehtimäki <matti.lehtimaki@gmail.com> | 2012-04-13 23:24:02 +0300 |
---|---|---|
committer | Matti Lehtimäki <matti.lehtimaki@gmail.com> | 2012-04-13 23:24:02 +0300 |
commit | 827dc1da7b18c57102cff7d3785041542c3e76e4 (patch) | |
tree | 2a77dbed08a9162aec727b27a2efbb50ee7eb21a /epghandler.c | |
parent | 9adbd81f5cbf42dc3fc45bad3d3376cdfbb7563f (diff) | |
download | vdr-plugin-epgfixer-827dc1da7b18c57102cff7d3785041542c3e76e4.tar.gz vdr-plugin-epgfixer-827dc1da7b18c57102cff7d3785041542c3e76e4.tar.bz2 |
Add support for channel IDs. Cleaning up code.
Diffstat (limited to 'epghandler.c')
-rw-r--r-- | epghandler.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/epghandler.c b/epghandler.c index cf84838..d01fadf 100644 --- a/epghandler.c +++ b/epghandler.c @@ -130,13 +130,10 @@ void cEpgfixerEpgHandler::FixOriginalEpgBugs(cEvent *event) // Some channels put the same information into ShortText and Description. // In that case we delete one of them: if (EpgfixerSetup.equalshorttextanddescription && event->ShortText() && event->Description() && strcmp(event->ShortText(), event->Description()) == 0) { - if (strlen(event->ShortText()) > MAX_USEFUL_EPISODE_LENGTH) { + if (strlen(event->ShortText()) > MAX_USEFUL_EPISODE_LENGTH) event->SetShortText(NULL); - } - else { + else event->SetDescription(NULL); - - } } // Some channels use the ` ("backtick") character, where a ' (single quote) @@ -246,14 +243,15 @@ bool cEpgfixerEpgHandler::ApplyRegexp(cRegexp *regexp, cEvent *Event, const char if (regexp->NumChannels() > 0) { bool found = false; int i = 0; - while (i < regexp->NumChannels()) { - if (Channels.GetByChannelID(Event->ChannelID())->Number() == regexp->GetChannel(i)) + while (i < regexp->NumChannels() && !found) { + if (Channels.GetByChannelID(Event->ChannelID())->Number() == regexp->GetChannelNum(i)) + found = true; + if (regexp->GetChannelID(i) && strcmp(*(Event->ChannelID().ToString()), regexp->GetChannelID(i)) == 0) found = true; i++; } - if (!found) { + if (!found) active = false; - } } if (active && regexp->Enabled() && regexp->GetRe()) { const char *string; |