]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
imagecache: fix 'accessed' field loading and the default value, issue #4304
authorJaroslav Kysela <perex@perex.cz>
Fri, 30 Nov 2018 07:58:18 +0000 (08:58 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 30 Nov 2018 07:58:18 +0000 (08:58 +0100)
src/imagecache.c

index 937e24bcec2c02a82e07941d13b5dd044537d376..ea41d939d625c017b2f6da9a47ec3f511b1c2778 100644 (file)
@@ -445,10 +445,11 @@ imagecache_init ( void )
       if (!(e   = htsmsg_get_map_by_field(f))) continue;
       if (!(id  = atoi(htsmsg_field_name(f)))) continue;
       if (!(url = htsmsg_get_str(e, "url"))) continue;
-      img          = calloc(1, sizeof(imagecache_image_t));
-      img->id      = id;
-      img->url     = strdup(url);
-      img->updated = htsmsg_get_s64_or_default(e, "updated", 0);
+      img           = calloc(1, sizeof(imagecache_image_t));
+      img->id       = id;
+      img->url      = strdup(url);
+      img->accessed = htsmsg_get_s64_or_default(e, "accessed", gclk());
+      img->updated  = htsmsg_get_s64_or_default(e, "updated", 0);
       sha1 = htsmsg_get_str(e, "sha1");
       if (sha1 && strlen(sha1) == 40)
         hex2bin(img->sha1, 20, sha1);