]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Updated various EPG calls to the new API.
authorAdam Sutton <dev@adamsutton.me.uk>
Fri, 25 May 2012 08:55:55 +0000 (09:55 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Mon, 30 Jul 2012 14:46:52 +0000 (15:46 +0100)
src/channels.c
src/epggrab/pyepg.c
src/epggrab/xmltv.c
src/htsp.c
src/webui/extjs.c
src/webui/simpleui.c

index f83c070de6c32aa197c5ba28fe2e6825541b03fd..76659115ffe4a1698396721ce4ab4209f876a63b 100644 (file)
@@ -182,7 +182,7 @@ channel_create(const char *name, int number)
 
   assert(x == NULL);
 
-  epg_add_channel(ch);
+  epg_channel_map_add(ch);
 
   htsp_channel_add(ch);
   return ch;
@@ -249,7 +249,7 @@ channel_load_one(htsmsg_t *c, int id)
 
   channel_set_name(ch, name);
 
-  epg_add_channel(ch);
+  epg_channel_map_add(ch);
 
   tvh_str_update(&ch->ch_icon, htsmsg_get_str(c, "icon"));
 
@@ -339,7 +339,7 @@ channel_rename(channel_t *ch, const char *newname)
 
   RB_REMOVE(&channel_name_tree, ch, ch_name_link);
   channel_set_name(ch, newname);
-  epg_mod_channel(ch);
+  epg_channel_map_mod(ch);
 
   LIST_FOREACH(t, &ch->ch_services, s_ch_link)
     t->s_config_save(t);
@@ -379,7 +379,7 @@ channel_delete(channel_t *ch)
     s->ths_channel = NULL;
   }
 
-  epg_rem_channel(ch);
+  epg_channel_map_rem(ch);
 
   hts_settings_remove("channels/%d", ch->ch_id);
 
@@ -492,6 +492,7 @@ channel_set_epg_source(channel_t *ch, epg_channel_t *ec)
     return;
 
   ch->ch_epg_channel = ec;
+  // TODO: should I do this?
   htsp_channel_update(ch); // Not sure?
 }
 
index 4ab41ca2665cdbcd94370ba3fa859608e6843266..31de4c566b11313bf6e893f044ddc02af72336f2 100644 (file)
@@ -185,14 +185,14 @@ static int _pyepg_parse_episode ( htsmsg_t *data, epggrab_stats_t *stats )
   /* Set brand */
   if ((str = htsmsg_get_str(attr, "brand"))) {
     if ((brand = epg_brand_find_by_uri(str, 0, NULL))) {
-      save |= epg_episode_set_brand(episode, brand, 1);
+      save |= epg_episode_set_brand(episode, brand);
     }
   }
 
   /* Set season */
   if ((str = htsmsg_get_str(attr, "series"))) {
     if ((season = epg_season_find_by_uri(str, 0, NULL))) {
-      save |= epg_episode_set_season(episode, season, 1);
+      save |= epg_episode_set_season(episode, season);
     }
   }
 
@@ -254,9 +254,6 @@ static int _pyepg_parse_broadcast
   if (!_pyepg_parse_time(start, &tm_start)) return 0;
   if (!_pyepg_parse_time(stop, &tm_stop)) return 0;
 
-  /* Ignore */
-  if(tm_stop <= tm_start || tm_stop < dispatch_clock) return 0;
-
   /* Find broadcast */
   broadcast = epg_broadcast_find_by_time(channel, tm_start, tm_stop, 1, &save);
   if ( broadcast == NULL ) return 0;
@@ -264,7 +261,7 @@ static int _pyepg_parse_broadcast
   if ( save ) stats->broadcasts.created++;
 
   /* Set episode */
-  save |= epg_broadcast_set_episode(broadcast, episode, 1);
+  save |= epg_broadcast_set_episode(broadcast, episode);
 
   /* TODO: extra metadata */
   
@@ -383,8 +380,11 @@ static htsmsg_t* _pyepg_grab ( const char *iopts )
   tvhlog(LOG_DEBUG, "pyepg", "grab %s %s", argv[0], iopts ? iopts : ""); 
 
   /* Grab */
-  // TODO: HACK: use static input
+#if 0
   outlen = spawn_and_store_stdout(argv[0], (char *const*)argv, &outbuf);
+#else
+  outlen = spawn_and_store_stdout("/home/aps/tmp/epg.sh", NULL, &outbuf);
+#endif
   free(opts);
   if ( outlen < 1 ) {
     tvhlog(LOG_ERR, "pyepg", "no output detected");
index 00672453c0ff14f904537edd8d39cff1771d66a6..7e7d0bca831d35f1c29d74435291643279185321 100644 (file)
@@ -269,7 +269,7 @@ _xmltv_parse_programme_tags(epg_channel_t *xc, htsmsg_t *tags,
   if ( ebc != NULL ) {
     stats->broadcasts.total++;
     if (save2) stats->broadcasts.created++;
-    save2 |= epg_broadcast_set_episode(ebc, ee, 1);
+    save2 |= epg_broadcast_set_episode(ebc, ee);
     if (save2) stats->broadcasts.modified++;
   }
   
index abfb147c3b4f39b4e16ec2a19b13491793fc0b31..8660ee125a0177cfcc38f86833f52bc5ee5c3fea 100644 (file)
@@ -808,7 +808,7 @@ htsp_method_getEvents(htsp_connection_t *htsp, htsmsg_t *in)
   if(htsmsg_get_u32(in, "numFollowing", &numFollowing))
     return htsp_error("Missing argument 'numFollowing'");
 
-  if((e = epg_broadcast_find_by_id(eventid)) == NULL) {
+  if((e = epg_broadcast_find_by_id(eventid, NULL)) == NULL) {
     return htsp_error("Event does not exist");
   }
 
@@ -841,7 +841,7 @@ htsp_method_getEvent(htsp_connection_t *htsp, htsmsg_t *in)
   if(htsmsg_get_u32(in, "eventId", &eventid))
     return htsp_error("Missing argument 'eventId'");
 
-  if((e = epg_broadcast_find_by_id(eventid)) == NULL)
+  if((e = epg_broadcast_find_by_id(eventid, NULL)) == NULL)
     return htsp_error("Event does not exist");
 
   out = htsp_build_event(e);  
index a7116c591e990d79b4957cc511b90e8bef9aef76..f1b07f032d1af771bb2b67a3ec7f04a2b6e6a355 100644 (file)
@@ -793,7 +793,7 @@ extjs_epgrelated(http_connection_t *hc, const char *remain, void *opaque)
 
   pthread_mutex_lock(&global_lock);
   if ( id && type ) {
-    e = epg_broadcast_find_by_id(atoi(id));
+    e = epg_broadcast_find_by_id(atoi(id), NULL);
     if ( e && e->episode ) {
       ee = e->episode;
 
index d96b3f9221e8b471f5edfd88b6080eb0f67a6bcf..d43eadaa1cd7a9a6a3e8adc95a58ee3ed2730802 100644 (file)
@@ -204,7 +204,7 @@ page_einfo(http_connection_t *hc, const char *remain, void *opaque)
 
   pthread_mutex_lock(&global_lock);
 
-  if(remain == NULL || (e = epg_broadcast_find_by_id(atoi(remain))) == NULL) {
+  if(remain == NULL || (e = epg_broadcast_find_by_id(atoi(remain), NULL)) == NULL) {
     pthread_mutex_unlock(&global_lock);
     return 404;
   }