From 1bf4b4c84c58e52b813b3e681444d46cdbe8904c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 12 Dec 2018 19:13:19 +0100 Subject: [PATCH] imagecache: do not update the accessed field too much --- src/imagecache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/imagecache.c b/src/imagecache.c index 502c466ab..4a818d347 100644 --- a/src/imagecache.c +++ b/src/imagecache.c @@ -66,6 +66,11 @@ struct imagecache_config imagecache_conf = { static htsmsg_t *imagecache_class_save(idnode_t *self, char *filename, size_t fsize); static void imagecache_destroy(imagecache_image_t *img, int delconf); +static inline time_t clkwrap(time_t clk) +{ + return clk / 4096; /* more than one hour */ +} + CLASS_DOC(imagecache) const idclass_t imagecache_class = { @@ -675,7 +680,7 @@ imagecache_get_id ( const char *url ) id = i->id; clk = gclk(); - if (clk != i->accessed) { + if (clkwrap(clk) != clkwrap(i->accessed)) { i->accessed = clk; save = 1; } -- 2.47.2