]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
fix epggrab periodic save and timeshift max_period handling (regression idnode rewrit...
authorJaroslav Kysela <perex@perex.cz>
Mon, 12 Oct 2015 18:33:32 +0000 (20:33 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 12 Oct 2015 18:33:32 +0000 (20:33 +0200)
src/config.c
src/epgdb.c
src/htsp_server.c
src/timeshift.c

index 5b680b097ea492f30db793f2c731c16c70358da1..ffdd9a799c0f4af7dfc749aa810d717a1e81c577 100644 (file)
@@ -1323,6 +1323,28 @@ config_migrate_v21 ( void )
   }
 }
 
+/*
+ * v21 -> v22 : epggrab missing changes
+ */
+static void
+config_migrate_v22 ( void )
+{
+  htsmsg_t *c;
+  uint32_t u32;
+
+  if ((c = hts_settings_load("epggrab/config")) != NULL) {
+    if (htsmsg_get_u32(c, "epgdb_periodicsave", &u32) == 0)
+      htsmsg_set_u32(c, "epgdb_periodicsave", (u32 + 3600 - 1) / 3600);
+    hts_settings_save(c, "epggrab/config");
+    htsmsg_destroy(c);
+  }
+  if ((c = hts_settings_load("timeshift/config")) != NULL) {
+    if (htsmsg_get_u32(c, "max_period", &u32) == 0)
+      htsmsg_set_u32(c, "max_period", (u32 + 60 - 1) / 60);
+    hts_settings_save(c, "timeshift/config");
+    htsmsg_destroy(c);
+  }
+}
 
 
 
@@ -1443,7 +1465,8 @@ static const config_migrate_t config_migrate_table[] = {
   config_migrate_v18,
   config_migrate_v19,
   config_migrate_v20,
-  config_migrate_v21
+  config_migrate_v21,
+  config_migrate_v22
 };
 
 /*
index edc6d07c22d674b235889823e97f38b65bc703ed..3813d1a834a018469b49c4caf1c6bb0b5a823d44 100644 (file)
@@ -334,7 +334,7 @@ void epg_save ( void )
 
   if (epggrab_conf.epgdb_periodicsave)
     gtimer_arm(&epggrab_save_timer, epg_save_callback, NULL,
-               epggrab_conf.epgdb_periodicsave);
+               epggrab_conf.epgdb_periodicsave * 3600);
 
   memset(&stats, 0, sizeof(stats));
   if ( _epg_write_sect(sb, "config") ) goto error;
index 49b4705d8fef3d04c6b121cc8e67356a62f0e0be..92d83890eec73386f2a61823a64e6a74608fde2b 100644 (file)
@@ -2083,7 +2083,7 @@ htsp_method_subscribe(htsp_connection_t *htsp, htsmsg_t *in)
   if (timeshift_conf.enabled) {
     timeshiftPeriod = htsmsg_get_u32_or_default(in, "timeshiftPeriod", 0);
     if (!timeshift_conf.unlimited_period)
-      timeshiftPeriod = MIN(timeshiftPeriod, timeshift_conf.max_period);
+      timeshiftPeriod = MIN(timeshiftPeriod, timeshift_conf.max_period * 60);
   }
 #endif
 
index 448d4b9f7820836fd1bae52733f0ca3cc7c95abd..3f60d7e4690e07d663a811b7a3689b162b4be5f0 100644 (file)
@@ -58,7 +58,7 @@ void timeshift_init ( void )
   /* Defaults */
   memset(&timeshift_conf, 0, sizeof(timeshift_conf));
   timeshift_conf.idnode.in_class = &timeshift_conf_class;
-  timeshift_conf.max_period       = 3600;                    // 1Hr
+  timeshift_conf.max_period       = 60;                      // Hr (60mins)
   timeshift_conf.max_size         = 10000 * (size_t)1048576; // 10G
 
   /* Load settings */