]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Remove erroneous assert() and modified so that existing EPG database and config is...
authorAdam Sutton <dev@adamsutton.me.uk>
Sat, 16 Jun 2012 19:20:46 +0000 (20:20 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Mon, 30 Jul 2012 14:47:55 +0000 (15:47 +0100)
src/epg.c
src/epggrab.c

index 8e795730e0b4530d228152e907449f88f0e58cbd..cbbd4314dc9ed28775db31092f95a3f4e7253b1a 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
 #include "htsmsg_binary.h"
 #include "epggrab.h"
 
+/* EPG database file */
+#define EPG_DB_OLD "epgdb"
+#define EPG_DB_NEW "epgdb.aps"
+
 /* Broadcast hashing */
 #define EPG_HASH_WIDTH 1024
 #define EPG_HASH_MASK  (EPG_HASH_WIDTH - 1)
@@ -159,7 +163,7 @@ static int _epg_write ( int fd, htsmsg_t *m )
   if(ret) {
     tvhlog(LOG_ERR, "epg", "failed to store epg to disk");
     close(fd);
-    hts_settings_remove("epgdb");
+    hts_settings_remove(EPG_DB_NEW);
   }
   return ret;
 }
@@ -179,7 +183,7 @@ void epg_save ( void )
   channel_t *ch;
   epggrab_stats_t stats;
   
-  fd = hts_settings_open_file(1, "epgdb");
+  fd = hts_settings_open_file(1, EPG_DB_NEW);
 
   memset(&stats, 0, sizeof(stats));
   if ( _epg_write_sect(fd, "brands") ) return;
@@ -225,7 +229,8 @@ void epg_init ( void )
   int old = 0;
   
   /* Map file to memory */
-  fd = hts_settings_open_file(0, "epgdb");
+  fd = hts_settings_open_file(0, EPG_DB_NEW);
+  if (fd < 0) fd = hts_settings_open_file(0, EPG_DB_OLD);
   if ( fd < 0 ) {
     tvhlog(LOG_DEBUG, "epg", "database does not exist");
     return;
index d1a6a7054907327e4bf719b8bc7ee1fdc4901c1d..203b638e810806f494ed808246e3c9968bc01b6f 100644 (file)
@@ -656,8 +656,6 @@ static void _epggrab_load ( void )
 
   /* Load settings */
   if (!(m = hts_settings_load("epggrab/config"))) {
-    printf("failed to load config\n");
-    assert(0);
     if ((m = hts_settings_load("xmltv/config")))
       old = 1;
   }