diff options
author | horchi <vdr@jwendel.de> | 2018-02-10 08:08:22 +0100 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2018-02-10 08:08:22 +0100 |
commit | 8e2744bd67e944ec68204b7999c905662b1c6bbd (patch) | |
tree | 114e3a5ba5658bce06f3883d95588fdfac45431a | |
parent | 603be72552dec1465ae49fc392930a678f28bef1 (diff) | |
download | vdr-epg-daemon-8e2744bd67e944ec68204b7999c905662b1c6bbd.tar.gz vdr-epg-daemon-8e2744bd67e944ec68204b7999c905662b1c6bbd.tar.bz2 |
2018-02-10: version 1.1.131 (horchi)\n - added: Support delete for switch timer\n - added: Table for recording images (still under development)\n\n1.1.131
-rw-r--r-- | HISTORY.h | 13 | ||||
-rw-r--r-- | lib/common.c | 10 | ||||
-rw-r--r-- | lib/common.h | 2 | ||||
-rw-r--r-- | webstore.c | 22 |
4 files changed, 31 insertions, 16 deletions
@@ -4,8 +4,8 @@ * ----------------------------------- */ -#define _VERSION "1.1.130" -#define VERSION_DATE "09.02.2018" +#define _VERSION "1.1.131" +#define VERSION_DATE "10.02.2018" #define DB_API 6 #ifdef GIT_REV @@ -17,10 +17,15 @@ /* * ------------------------------------ * + +2018-02-10: version 1.1.131 (horchi) + - added: Support delete for switch timer + - added: Table for recording images (still under development) + 2018-02-09: version 1.1.130 (rechner) - added: Icons for timertypes - - added: switchtimer on eventDetail - + - added: switchtimer on eventDetail + 2018-02-09: version 1.1.129 (horchi) - added: Table for recording images diff --git a/lib/common.c b/lib/common.c index 9207083..cccf8fa 100644 --- a/lib/common.c +++ b/lib/common.c @@ -662,11 +662,11 @@ int l2hhmm(time_t t) // HHMM to Pretty Time //*************************************************************************** -std::string hhmm2pTime(int hhmm) +std::string hhmm2pTime(int hhmm, const char* delim) { char txt[100]; - sprintf(txt, "%02d:%02d", hhmm / 100, hhmm % 100); + sprintf(txt, "%02d%s%02d", hhmm / 100, delim, hhmm % 100); return std::string(txt); } @@ -882,7 +882,7 @@ int isLink(const char* path) if (lstat(path, &sb) == 0) return S_ISLNK(sb.st_mode); - tell(0, "Error: Detecting state for '%s' failed, error was '%s'", path, strerror(errno)); + tell(0, "Warning: Detecting file state for '%s' failed, error was '%s'", path, strerror(errno)); return false; } @@ -904,7 +904,7 @@ int fileSize(const char* path) if (lstat(path, &sb) == 0) return sb.st_size; - tell(0, "Error: Detecting state for '%s' failed, error was '%s'", path, strerror(errno)); + tell(0, "Warning: Detecting size for '%s' failed, error was '%s'", path, strerror(errno)); return 0; } @@ -916,7 +916,7 @@ time_t fileModTime(const char* path) if (lstat(path, &sb) == 0) return sb.st_mtime; - tell(0, "Error: Detecting state for '%s' failed, error was '%s'", path, strerror(errno)); + tell(0, "Warning: Detecting modification timer for '%s' failed, error was '%s'", path, strerror(errno)); return 0; } diff --git a/lib/common.h b/lib/common.h index b488783..0b9c284 100644 --- a/lib/common.h +++ b/lib/common.h @@ -290,7 +290,7 @@ int weekdayOf(time_t t); const char* toWeekdayName(uint day); time_t hhmmOf(time_t t); int l2hhmm(time_t t); -std::string hhmm2pTime(int hhmm); +std::string hhmm2pTime(int hhmm, const char* delim = ":"); time_t midnightOf(time_t t); std::string l2pTime(time_t t, const char* format = "%d.%m.%Y %T"); std::string l2pDate(time_t t); @@ -114,8 +114,7 @@ int cEpgHttpd::deleteTimerJobs(json_t* jInData, json_t* response) for (int i = 0; i < length; ++i) { - json_t* obj = json_array_get(idArray, i); - long id = json_integer_value(obj); + json_t* obj = json_array_get(idArray, i); long id = json_integer_value(obj); // delete olny if not assumed in meanwhile! @@ -176,6 +175,7 @@ int cEpgHttpd::storeTimerJob(json_t* jInData, json_t* response) else { long int eventStartTime = 0; + long int eventEndTime = 0; cDbRow timerRow("timers"); timerRow.clear(); @@ -202,10 +202,10 @@ int cEpgHttpd::storeTimerJob(json_t* jInData, json_t* response) "aborting request!", eventid); } - long int endTime = useeventsDb->getIntValue("STARTTIME") + useeventsDb->getIntValue("DURATION"); + eventEndTime = useeventsDb->getIntValue("STARTTIME") + useeventsDb->getIntValue("DURATION"); eventStartTime = useeventsDb->getIntValue("STARTTIME"); - if (endTime < time(0)) + if (eventEndTime < time(0)) { selectEvent->freeResult(); @@ -318,6 +318,18 @@ int cEpgHttpd::storeTimerJob(json_t* jInData, json_t* response) timerRow.setValue("TEMPLATE", tmplExpression); timerRow.setValue("NAMINGMODE", namingmode); + if (*type != ttView) + { + getFieldFromJson(jInData, &timerRow, "STARTTIME"); + getFieldFromJson(jInData, &timerRow, "ENDTIME"); + } + else + { + day = eventStartTime; + timerRow.setValue("STARTTIME", l2hhmm(hhmmOf(eventStartTime))); + timerRow.setValue("ENDTIME", l2hhmm(hhmmOf(eventEndTime))); + } + if (day != na) { day = midnightOf(day); @@ -335,8 +347,6 @@ int cEpgHttpd::storeTimerJob(json_t* jInData, json_t* response) if (timerRow.getValue("VDRUUID")->isEmpty()) timerRow.setValue("VDRUUID", "any"); // the default - getFieldFromJson(jInData, &timerRow, "STARTTIME"); - getFieldFromJson(jInData, &timerRow, "ENDTIME"); getFieldFromJson(jInData, &timerRow, "WEEKDAYS"); getFieldFromJson(jInData, &timerRow, "VPS"); getFieldFromJson(jInData, &timerRow, "PRIORITY"); |