diff options
author | horchi <vdr@jwendel.de> | 2017-03-20 18:03:45 +0100 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2017-03-20 18:03:45 +0100 |
commit | dfdedfcafbca62a0a5a327b6ee1b453e0341a753 (patch) | |
tree | e2ba4f9bdd35f8b8291eabd677e6fac2c1ccd98d /update.c | |
parent | 42b9898a8a4a07a3134dadce5d24618a0c402fd1 (diff) | |
parent | 4ab12d84b2738fbfc9aafed6b4710180aa2d37e4 (diff) | |
download | vdr-epg-daemon-dfdedfcafbca62a0a5a327b6ee1b453e0341a753.tar.gz vdr-epg-daemon-dfdedfcafbca62a0a5a327b6ee1b453e0341a753.tar.bz2 |
2017-03-20: version 1.1.113 (horchi)\n -added: Add validity check of the API key for https://www.themoviedb.org (by 3po)\n - change: Removed compiler warnings when using clang\n - added: Added clang++ to Make.config (as optional compiler)\n\n
Diffstat (limited to 'update.c')
-rw-r--r-- | update.c | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -1808,7 +1808,7 @@ int cEpgd::parseEvent(cDbRow* event, xmlNode* node) event->getBigintValue("EVENTID"), event->getStrValue("FILEREF")); - event->setValue("IMAGECOUNT", imgCnt); + event->setValue("IMAGECOUNT", min(imgCnt, EpgdConfig.maximagesperevent)); free(images); free(imagetype); @@ -1829,6 +1829,8 @@ int cEpgd::storeImageRefs(tEventId evtId, const char* source, const char* images char* imagesCsv = strdup(images); int count = 0; + // #TODO limit here to EpgdConfig.maximagesperevent + for (char* p = imagesCsv; p && *p; p = next, lfn++) { if ((next = strchr(p, ','))) @@ -2314,9 +2316,6 @@ int cEpgd::scrapNewEvents() if (seriesCur % 10 == 0) tell(0, "series episode %d / %d scraped...continuing scraping", seriesCur, seriesTotal); - if (seriesCur % 50 == 0) - sleep(1); - tvdbManager->ProcessSeries(*it); if (doShutDown()) @@ -2354,6 +2353,8 @@ int cEpgd::scrapNewEvents() tell(0, "%d new movies to scrap in db", moviesTotal); + time_t sectionStartAt = time(0); // split download in parts of 40 + for (vector<sMovieResult>::iterator it = moviesToScrap.begin(); it != moviesToScrap.end(); ++it) { movieCur++; @@ -2361,8 +2362,19 @@ int cEpgd::scrapNewEvents() if (movieCur % 10 == 0) tell(0, "movie %d / %d scraped...continuing scraping", movieCur, moviesTotal); - if (movieCur % 50 == 0) - sleep(1); + if (movieCur % 40 == 0) + { + int duration = time(0) - sectionStartAt; + + if (duration < 10) + { + duration = 10 - duration; + tell(0, "Waiting %d seconds..", duration); + sleep(duration); + } + + sectionStartAt = time(0); + } movieDbManager->ProcessMovie(*it); |