]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Changed gui parameter to take a numeric value which is the 257/head
authorandyb2000 <andy@broadcast-tech.co.uk>
Thu, 7 Mar 2013 21:35:15 +0000 (21:35 +0000)
committerandyb2000 <andy@broadcast-tech.co.uk>
Thu, 7 Mar 2013 21:35:15 +0000 (21:35 +0000)
number of hours to write data to disk

docs/html/config_epggrab.html
src/epgdb.c
src/webui/extjs.c
src/webui/static/app/epggrab.js

index 822348fa697639c821355a01d094426a145d8e97..7fbb33c25c4b081fb145d7bc919a52b27eb94a4e 100644 (file)
    <dt>Update channel name
    <dd>Automatically update channel icons using information provided
        by the enabled EPG providers.
-   <dt>Periodic save EPG to disk
-   <dd>Writes the current in-memory EPG database to disk every 8 Hours
-       when checked, so should a crash/unexpected shutdown occur EPG
+   <dt>Periodic save EPG to disk Interval
+   <dd>Writes the current in-memory EPG database to disk every x Hours
+       (user defined), so should a crash/unexpected shutdown occur EPG
        data is saved periodically to the database (Re-read on
        next startup)
+       Set to 0 to disable.
  </dl>
  
  <h3>Internal Grabber</h3>
index 71a3ff269d7f734d004b6edd2b7246314cd34ad4..bb61fbc1fc66735fa7397958e9dbc1523e6e9246 100644 (file)
@@ -148,14 +148,14 @@ static void *_epgdbsave_thread ( void *p )
   ts.tv_nsec = 0;
   tvhlog(LOG_DEBUG, "epgdb", "epgdbsave setting: %i", epggrab_epgdb_periodicsave);
   while (1) {
-    if (epggrab_epgdb_periodicsave) {
+    if (epggrab_epgdb_periodicsave != 0) {
       tvhlog(LOG_DEBUG, "epgdb", "epgdbsave setting: %i", 
              epggrab_epgdb_periodicsave);
       epg_save();
     };
     pthread_mutex_lock(&epgdbsave_mutex);
     time(&ts.tv_sec);
-    ts.tv_sec += 28800; /* Every 8 hours */
+    ts.tv_sec += epggrab_epgdb_periodicsave * 3600; /* User defined in hours */
     pthread_cond_timedwait(&_epgdbsave_cond, &epgdbsave_mutex, &ts);
     pthread_mutex_unlock(&epgdbsave_mutex);
   };
index 9546ef7b88aee8c6b7a9e5ae99f0e9c31f0a9f74..076739142120046fdbb07416ccd12c06b326d01c 100644 (file)
@@ -620,8 +620,8 @@ extjs_epggrab(http_connection_t *hc, const char *remain, void *opaque)
     save |= epggrab_set_channel_renumber(str ? 1 : 0);
     str = http_arg_get(&hc->hc_req_args, "channel_reicon");
     save |= epggrab_set_channel_reicon(str ? 1 : 0);
-    str = http_arg_get(&hc->hc_req_args, "epgdb_periodicsave");
-    save |= epggrab_set_periodicsave(str ? 1 : 0);
+    if ( (str = http_arg_get(&hc->hc_req_args, "epgdb_periodicsave")) )
+      save |= epggrab_set_periodicsave(atoi(str));
     if ( (str = http_arg_get(&hc->hc_req_args, "interval")) )
       save |= epggrab_set_interval(atoi(str));
     if ( (str = http_arg_get(&hc->hc_req_args, "module")) )
index af18c6dfdc56630ccff2c8dbd9047bbd892e4b71..e8fc37388ddf58498f9e5f98447c4948bd6a0e9a 100644 (file)
@@ -184,10 +184,16 @@ tvheadend.epggrab = function() {
                fieldLabel : 'Update channel icon'
        });
 
-       var epgPeriodicSave = new Ext.form.Checkbox({
-               name : 'epgdb_periodicsave',
-               fieldLabel : 'Periodic save EPG to disk'
-       });
+       var epgPeriodicSave = new Ext.form.NumberField({
+                width : 30,
+                allowNegative : false,
+                allowDecimals : false,
+                minValue : 0,
+                maxValue : 24,
+                value : 0,
+                fieldLabel : 'Periodic save EPG to disk',
+                name : 'epgdb_periodicsave',
+        });
 
        /*
         * Simple fields