From: Adam Sutton Date: Thu, 3 Jan 2013 11:52:36 +0000 (+0000) Subject: imagecache: fix re-fetch period mistake. X-Git-Tag: v3.5~202 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8de4efe6e5eea5c9926e186172a43a1242ad2874;p=thirdparty%2Ftvheadend.git imagecache: fix re-fetch period mistake. --- diff --git a/src/imagecache.c b/src/imagecache.c index 224c72cc9..cd2583bee 100644 --- a/src/imagecache.c +++ b/src/imagecache.c @@ -366,10 +366,12 @@ static void *_imagecache_thread ( void *p ) ts.tv_sec += 60; err = pthread_cond_timedwait(&_imagecache_cond, &imagecache_mutex, &ts); if (err == ETIMEDOUT) { + uint32_t period; RB_FOREACH(img, &_imagecache_by_url, url_link) { if (img->state != IDLE) continue; - if ((ts.tv_sec - img->updated) > - (img->failed ? imagecache_fail_period : imagecache_ok_period)) + period = img->failed ? imagecache_fail_period : imagecache_ok_period; + period *= 86400; + if (period && ((ts.tv_sec - img->updated) > period)) _imagecache_add(img); } }