]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Minor fix to get htsp epg download working.
authorAdam Sutton <dev@adamsutton.me.uk>
Fri, 25 May 2012 11:10:29 +0000 (12:10 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Fri, 25 May 2012 11:10:29 +0000 (12:10 +0100)
src/epg.c
src/epg.h
src/htsp.c

index 33fc6c04aabde3b5d92aa6ec8fb9e8867abc6aab..d76bc42f7d250499aad7823c3dfc1b63824c908c 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
@@ -1007,7 +1007,7 @@ int epg_broadcast_set_episode
 epg_broadcast_t *epg_broadcast_get_next ( epg_broadcast_t *broadcast )
 {
   if ( !broadcast ) return NULL;
-  return RB_NEXT(broadcast, slink);
+  return (epg_broadcast_t*)RB_NEXT((epg_object_t*)broadcast, glink);
 }
 
 htsmsg_t *epg_broadcast_serialize ( epg_broadcast_t *broadcast )
index 90c9c50261ee4d89fee8c427ffc5f657f1904e94..48591d5076c5c67671fa71fdbf6b9c659db6c5d3 100644 (file)
--- a/src/epg.h
+++ b/src/epg.h
@@ -235,7 +235,6 @@ typedef struct epg_broadcast
   uint8_t                    is_new;           ///< New series / file premiere
   uint8_t                    is_repeat;        ///< Repeat screening
 
-  RB_ENTRY(epg_broadcast)    slink;         ///< Schedule link
   RB_ENTRY(epg_broadcast)    elink;         ///< Episode link
   epg_episode_t             *episode;       ///< Episode shown
   epg_channel_t             *channel;       ///< Channel being broadcast on
@@ -344,6 +343,8 @@ void epg_updated (void);
  * Compatibility code
  * ***********************************************************************/
 
+#ifndef TODO_REMOVE_EPG_COMPAT 
+
 typedef struct _epg_episode {
 
   uint16_t ee_season;
@@ -382,41 +383,5 @@ typedef struct event {
   _epg_episode_t e_episode;
 
 } event_t;
-#if 0
-
-void epg_event_updated(event_t *e);
-
-event_t *epg_event_create(channel_t *ch, time_t start, time_t stop,
-                         int dvb_id, int *created);
-
-event_t *epg_event_find_by_time(channel_t *ch, time_t t);
-
-event_t *epg_event_find_by_id(int eventid);
-
-void epg_unlink_from_channel(channel_t *ch);
-
-
-/**
- *
- */
-uint8_t epg_content_group_find_by_name(const char *name);
-
-const char *epg_content_group_get_name(uint8_t type);
-
-/**
- *
- */
-typedef struct epg_query_result {
-  event_t **eqr_array;
-  int eqr_entries;
-  int eqr_alloced;
-} epg_query_result_t;
-
-void epg_query0(epg_query_result_t *eqr, channel_t *ch, channel_tag_t *ct,
-                uint8_t type, const char *title);
-void epg_query(epg_query_result_t *eqr, const char *channel, const char *tag,
-              const char *contentgroup, const char *title);
-void epg_query_free(epg_query_result_t *eqr);
-void epg_query_sort(epg_query_result_t *eqr);
 #endif
 #endif /* EPG_H */
index f6d2edb261cd5ba16a3eb0e25b8cb4ad716ec486..d1ade2eed7c769a20ebc09931ccd0569b0b33702 100644 (file)
@@ -296,6 +296,7 @@ htsp_build_channel(channel_t *ch, const char *method)
   channel_tag_t *ct;
   service_t *t;
   epg_broadcast_t *now, *next = NULL;
+  printf("htsp_build_channel(%s)\n", ch->ch_name);
 
   htsmsg_t *out = htsmsg_create_map();
   htsmsg_t *tags = htsmsg_create_list();
@@ -311,6 +312,7 @@ htsp_build_channel(channel_t *ch, const char *method)
   if (ch->ch_epg_channel) {
     now  = ch->ch_epg_channel->now;
     next = ch->ch_epg_channel->next;
+    printf("  now = %p, next = %p\n", now, next);
     htsmsg_add_u32(out, "eventId", now ? now->_.id : 0);
     htsmsg_add_u32(out, "nextEventId", next ? next->_.id : 0);
   }
@@ -751,13 +753,12 @@ htsp_build_event(epg_broadcast_t *e)
 #if TODO_DVR
   dvr_entry_t *de;
 #endif
+  printf("htsp_build_event(%p, %lu)\n", e, e->_.id);
 
   out = htsmsg_create_map();
 
   htsmsg_add_u32(out, "eventId", e->_.id);
-#if TODO_EPG_CHANNEL
-  htsmsg_add_u32(out, "channelId", e->e_channel->ch_id);
-#endif
+  htsmsg_add_u32(out, "channelId", e->channel->channel->ch_id);
   htsmsg_add_u32(out, "start", e->start);
   htsmsg_add_u32(out, "stop", e->stop);
   if(e->episode->title != NULL)
@@ -807,6 +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'");
+  printf("htsp_method_getEvents(%d, %d)\n", eventid, numFollowing);
 
   if((e = epg_broadcast_find_by_id(eventid, NULL)) == NULL) {
     return htsp_error("Event does not exist");
@@ -840,6 +842,7 @@ htsp_method_getEvent(htsp_connection_t *htsp, htsmsg_t *in)
   
   if(htsmsg_get_u32(in, "eventId", &eventid))
     return htsp_error("Missing argument 'eventId'");
+  printf("htsp_method_getEvent(%d)", eventid);
 
   if((e = epg_broadcast_find_by_id(eventid, NULL)) == NULL)
     return htsp_error("Event does not exist");