From fa5b99b253e0f619a17a8e75c996a2fc502c037f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=96man?= <andreas@lonelycoder.com>
Date: Sun, 6 Sep 2009 20:52:28 +0000
Subject: [PATCH] HTSP: Send contentType for EPG entries

---
 src/epg.c  | 1 +
 src/epg.h  | 1 +
 src/htsp.c | 3 +++
 3 files changed, 5 insertions(+)

diff --git a/src/epg.c b/src/epg.c
index 1a7dfb0e..e9872e51 100644
--- a/src/epg.c
+++ b/src/epg.c
@@ -445,6 +445,7 @@ epg_content_type_find_by_dvbcode(uint8_t dvbcode)
     ect->ect_group = ecg;
     snprintf(buf, sizeof(buf), "type%d", type);
     ect->ect_name = strdup(buf);
+    ect->ect_dvbcode = dvbcode;
   }
 
   return ect;
diff --git a/src/epg.h b/src/epg.h
index 855464af..2a0f576b 100644
--- a/src/epg.h
+++ b/src/epg.h
@@ -38,6 +38,7 @@ typedef struct epg_content_type {
   const char *ect_name;
   struct event_list ect_events;
   epg_content_group_t *ect_group;
+  uint8_t ect_dvbcode;
 } epg_content_type_t;
 
 /*
diff --git a/src/htsp.c b/src/htsp.c
index 220d0c0e..5a95d813 100644
--- a/src/htsp.c
+++ b/src/htsp.c
@@ -437,6 +437,9 @@ htsp_method_getEvent(htsp_connection_t *htsp, htsmsg_t *in)
   if(e->e_desc != NULL)
     htsmsg_add_str(out, "description", e->e_desc);
 
+  if(e->e_content_type != NULL)
+    htsmsg_add_u32(out, "contentType", e->e_content_type->ect_dvbcode);
+
   n = RB_NEXT(e, e_channel_link);
   if(n != NULL)
     htsmsg_add_u32(out, "nextEventId", n->e_id);