]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add /epgsave to the webui so you can trigger a write of the epgdb
authorandyb2000 <andy@broadcast-tech.co.uk>
Thu, 7 Mar 2013 10:12:41 +0000 (10:12 +0000)
committerandyb2000 <andy@broadcast-tech.co.uk>
Thu, 7 Mar 2013 10:12:41 +0000 (10:12 +0000)
to disk to help debugging, etc

src/epgdb.c
src/webui/simpleui.c

index 30ee6caad69f9ca8b23111e1a27e26df5b294db5..616ab4ed54ac5af40beb217396ee22f51217d5a6 100644 (file)
@@ -227,8 +227,6 @@ void epg_init ( void )
   munmap(mem, st.st_size);
   close(fd);
 
-  /* Create timer thread */
-
 }
 
 /* **************************************************************************
index af768ae1c1276efd20e1ecb55f93400a390d7945..36dcda10392eee8b7714fc161e1e3c08fa2250c6 100644 (file)
@@ -471,6 +471,25 @@ page_status(http_connection_t *hc,
   return 0;
 }
 
+/**
+ * flush epgdb to disk on call
+ */
+static int
+page_epgsave(http_connection_t *hc,
+           const char *remain, void *opaque)
+{
+  htsbuf_queue_t *hq = &hc->hc_reply;
+
+  htsbuf_qprintf(hq, "<?xml version=\"1.0\"?>\n"
+                 "<epgflush>1</epgflush>\n");
+
+  epg_save();
+
+  http_output_content(hc, "text/xml");
+
+  return 0;
+}
+
 
 
 /**
@@ -483,5 +502,5 @@ simpleui_start(void)
   http_path_add("/eventinfo",   NULL, page_einfo,   ACCESS_SIMPLE);
   http_path_add("/pvrinfo",     NULL, page_pvrinfo, ACCESS_SIMPLE);
   http_path_add("/status.xml",  NULL, page_status,  ACCESS_SIMPLE);
-  http_path_add("/epgflush",   NULL, epg_save,     ACCESS_SIMPLE);
+  http_path_add("/epgsave",    NULL, page_epgsave,     ACCESS_SIMPLE);
 }