diff options
author | horchi <vdr@jwendel.de> | 2018-04-20 06:22:48 +0200 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2018-04-20 06:22:48 +0200 |
commit | 0e35ada8c0b0838310b2fda0357acfd8a106ce4c (patch) | |
tree | 71e50f061b93bdc623a1d7e9c0339b6ccd324c60 /lib/searchtimer.c | |
parent | cc0ddd47a78d451b445cfa7667757400c619cd5b (diff) | |
download | vdr-epg-daemon-0e35ada8c0b0838310b2fda0357acfd8a106ce4c.tar.gz vdr-epg-daemon-0e35ada8c0b0838310b2fda0357acfd8a106ce4c.tar.bz2 |
2018-04-18: version 1.1.139 (horchi)\n change: Prepared search timer filter by channel number (to be added to WEBIF)\n\n1.1.139
Diffstat (limited to 'lib/searchtimer.c')
-rw-r--r-- | lib/searchtimer.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/searchtimer.c b/lib/searchtimer.c index 77b19f1..0eb7218 100644 --- a/lib/searchtimer.c +++ b/lib/searchtimer.c @@ -205,7 +205,7 @@ int cSearchTimer::initDb() selectChannelFromMap = new cDbStatement(mapDb); selectChannelFromMap->build("select "); - selectChannelFromMap->bind("CHANNELNAME", cDBS::bndOut); + selectChannelFromMap->bindAllOut(); selectChannelFromMap->build(" from %s where ", mapDb->TableName()); selectChannelFromMap->bind("CHANNELID", cDBS::bndIn | cDBS::bndSet); @@ -847,6 +847,9 @@ int cSearchTimer::matchCriterias(cDbRow* searchTimer, cDbRow* event) int rangeStart = searchTimer->getValue("STARTTIME")->isNull() ? (int)na : searchTimer->getIntValue("STARTTIME"); int rangeEnd = searchTimer->getValue("ENDTIME")->isNull() ? (int)na : searchTimer->getIntValue("ENDTIME"); int nextDays = searchTimer->getValue("NEXTDAYS")->isNull() ? (int)na : searchTimer->getIntValue("NEXTDAYS"); + int chNumMin = searchTimer->getIntValue("CHNUMMIN"); + int chNumMax = searchTimer->getIntValue("CHNUMMAX"); + int chNumber = na; const char* channelid = event->getStrValue("CHANNELID"); time_t starttime = event->getIntValue("STARTTIME"); @@ -865,9 +868,24 @@ int cSearchTimer::matchCriterias(cDbRow* searchTimer, cDbRow* event) return no; } + chNumber = mapDb->getIntValue("ORDER"); mapDb->reset(); - // check channel matches + // check channel number + + if (chNumMax > 0 && chNumber > chNumMax) + { + tell(3, "AUTOTIMER: Skipping hit due to channel number - '%d' > '%d'", chNumber, chNumMax); + return no; + } + + if (chNumMin > 0 && chNumber < chNumMin) + { + tell(3, "AUTOTIMER: Skipping hit due to channel number - '%d' < '%d'", chNumber, chNumMin); + return no; + } + + // check channelid matches if (!isEmpty(channelids)) { |