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 | |
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
-rw-r--r-- | HISTORY.h | 7 | ||||
-rw-r--r-- | configs/epg.dat | 3 | ||||
-rw-r--r-- | lib/json.c | 10 | ||||
-rw-r--r-- | lib/searchtimer.c | 22 | ||||
-rwxr-xr-x | scripts/epgd-dropall | 6 |
5 files changed, 39 insertions, 9 deletions
@@ -4,8 +4,8 @@ * ----------------------------------- */ -#define _VERSION "1.1.138" -#define VERSION_DATE "11.03.2018" +#define _VERSION "1.1.139" +#define VERSION_DATE "18.04.2018" #define DB_API 7 #ifdef GIT_REV @@ -18,6 +18,9 @@ * ------------------------------------ * +2018-04-18: version 1.1.139 (horchi) + change: Prepared search timer filter by channel number (to be added to WEBIF) + 2018-03-11: version 1.1.138 (horchi) change: Fixed image problem with epgdata due to interface change by epgdata (patch by seahawk1986) diff --git a/configs/epg.dat b/configs/epg.dat index fd29f54..61c48f6 100644 --- a/configs/epg.dat +++ b/configs/epg.dat @@ -672,7 +672,8 @@ Table searchtimers CHANNELIDS "comma separated list of channleids or empty" channelids Ascii 500 Data, CHEXCLUDE "" chexclude UInt 0 Data, CHFORMAT "HD,SD" chformat Ascii 50 Data, - + CHNUMMIN "min channel number" chnummin UInt 0 Data, + CHNUMMAX "max channel number" chnummax UInt 0 Data, NAME "Bezeichung des Suchtimers" name Ascii 100 Data, EXPRESSION "" expression Ascii 200 Data, EXPRESSION1 "" expression1 Ascii 200 Data, @@ -116,13 +116,17 @@ int getFieldFromJson(json_t* obj, cDbRow* row, const char* fname, const char* ex case cDBS::ffInt: case cDBS::ffUInt: { - int v = getIntFromJson(obj, jname, na); - const char* s = getStringFromJson(obj, jname, ""); + int v = getIntFromJson(obj, jname, 0); + const char* s = getStringFromJson(obj, jname, "_not_set_"); + + if (s && strcmp(s, "_not_set_") == 0) + break; if (s && strcmp(s, "null") == 0) value->setNull(); - else if (v != na || !value->isEmpty()) + else value->setValue(v); + break; } 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)) { diff --git a/scripts/epgd-dropall b/scripts/epgd-dropall index f8a2d00..2e3910d 100755 --- a/scripts/epgd-dropall +++ b/scripts/epgd-dropall @@ -110,11 +110,15 @@ if [ "${i}" = "y" ]; then mysql -u epg2vdr -Depg2vdr -e 'drop table if exists movie_media;' mysql -u epg2vdr -Depg2vdr -e 'drop view if exists thetvdbview;' + mysql -u epg2vdr -Depg2vdr -e 'update events set scrseriesid = null, scrseriesepisode = null, scrmovieid = null, scrsp = null;' + mysql -u epg2vdr -Depg2vdr -e 'update recordinglist set scrseriesid = null, scrseriesepisode = null, scrmovieid = null, scrnew = null, scrsp = null;' + + mysql -u epg2vdr -Depg2vdr -e 'drop table if exists usevents;' + echo "" echo "Scraper tables dropped!" fi - echo "-----------------------------" echo "-- Tables with User Data --" echo "-----------------------------" |