From: andyb2000 Date: Thu, 7 Mar 2013 10:12:41 +0000 (+0000) Subject: Add /epgsave to the webui so you can trigger a write of the epgdb X-Git-Tag: v3.9~149^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b877c90034593e6d1dde426ae290928f1d241b7;p=thirdparty%2Ftvheadend.git Add /epgsave to the webui so you can trigger a write of the epgdb to disk to help debugging, etc --- diff --git a/src/epgdb.c b/src/epgdb.c index 30ee6caad..616ab4ed5 100644 --- a/src/epgdb.c +++ b/src/epgdb.c @@ -227,8 +227,6 @@ void epg_init ( void ) munmap(mem, st.st_size); close(fd); - /* Create timer thread */ - } /* ************************************************************************** diff --git a/src/webui/simpleui.c b/src/webui/simpleui.c index af768ae1c..36dcda103 100644 --- a/src/webui/simpleui.c +++ b/src/webui/simpleui.c @@ -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, "\n" + "1\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); }