]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
epg: remove unused argument for epg_broadcast_find_by_id(), replace atoi() with strto...
authorJaroslav Kysela <perex@perex.cz>
Sun, 5 Oct 2014 19:21:47 +0000 (21:21 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sun, 5 Oct 2014 19:22:31 +0000 (21:22 +0200)
src/api/api_dvr.c
src/api/api_epg.c
src/dvr/dvr_db.c
src/epg.c
src/epg.h
src/htsp_server.c
src/webui/simpleui.c

index e1e781bf7877bf9223dc36f6951192bc43a45e79..8d8185b0f3df75a717a28e767ecae7865a92fcd5 100644 (file)
@@ -223,7 +223,7 @@ api_dvr_entry_create_by_event
       continue;
 
     pthread_mutex_lock(&global_lock);
-    if ((e = epg_broadcast_find_by_id(atoi(s), NULL))) {
+    if ((e = epg_broadcast_find_by_id(strtoll(s, NULL, 10)))) {
       de = dvr_entry_create_by_event(api_dvr_config_name(perm, config_uuid),
                                      e, 0, 0, perm->aa_representative,
                                      NULL, DVR_PRIO_NORMAL, 0);
@@ -312,7 +312,7 @@ api_dvr_autorec_create_by_series
       continue;
 
     pthread_mutex_lock(&global_lock);
-    if ((e = epg_broadcast_find_by_id(atoi(s), NULL))) {
+    if ((e = epg_broadcast_find_by_id(strtoll(s, NULL, 10)))) {
       dae = dvr_autorec_add_series_link(api_dvr_config_name(perm, config_uuid),
                                         e, perm->aa_representative,
                                         "Created from EPG query");
index fd47017f573cd35bde166b2539404c731dd36d39..54a95fb1d56902f1e2bab545e22351f0f9620a9a 100644 (file)
@@ -474,7 +474,7 @@ api_epg_alternative
 
   /* Main Job */
   pthread_mutex_lock(&global_lock);
-  e = epg_broadcast_find_by_id(id, NULL);
+  e = epg_broadcast_find_by_id(id);
   if (e && e->episode)
     api_epg_episode_broadcasts(l, lang, e->episode, &entries, e);
   pthread_mutex_unlock(&global_lock);
@@ -501,7 +501,7 @@ api_epg_related
 
   /* Main Job */
   pthread_mutex_lock(&global_lock);
-  e = epg_broadcast_find_by_id(id, NULL);
+  e = epg_broadcast_find_by_id(id);
   ep = e ? e->episode : NULL;
   if (ep && ep->brand) {
     LIST_FOREACH(ep2, &ep->brand->episodes, blink) {
index cf364eedb5f35c5952facf6caf894881cc3d4d51..2764c50c230de16f17553fa27f7f8eaf09f2cf42 100644 (file)
@@ -1406,7 +1406,7 @@ dvr_entry_class_broadcast_set(void *o, const void *v)
   epg_broadcast_t *bcast;
   if (!dvr_entry_is_editable(de))
     return 0;
-  bcast = epg_broadcast_find_by_id(id, de->de_channel);
+  bcast = epg_broadcast_find_by_id(id);
   if (bcast == NULL) {
     if (de->de_bcast) {
       de->de_bcast->putref((epg_object_t*)de->de_bcast);
@@ -1860,7 +1860,7 @@ const idclass_t dvr_entry_class = {
     {
       .type     = PT_U32,
       .id       = "broadcast",
-      .name     = "Broadcast Type",
+      .name     = "Broadcast",
       .set      = dvr_entry_class_broadcast_set,
       .get      = dvr_entry_class_broadcast_get,
       .opts     = PO_RDONLY,
index 38d637977620629ddb1eb7f8e3bf57081900f65a..5d37838724095e5f68c014abdadb5750855887c6 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
@@ -1608,10 +1608,8 @@ epg_broadcast_t* epg_broadcast_find_by_time
   return _epg_channel_add_broadcast(channel, ebc, create, save);
 }
 
-epg_broadcast_t *epg_broadcast_find_by_id ( uint32_t id, channel_t *ch )
+epg_broadcast_t *epg_broadcast_find_by_id ( uint32_t id )
 {
-  // Note: I have left channel_t param, just in case I decide to change
-  //       to use it for shorter search
   return (epg_broadcast_t*)epg_object_find_by_id(id, EPG_BROADCAST);
 }
 
index 340a23f44b64feeee3d6e2b161a468f76d115dd6..c639bf4726941e64715fa8e6f8b89306941859ee 100644 (file)
--- a/src/epg.h
+++ b/src/epg.h
@@ -451,7 +451,7 @@ epg_broadcast_t *epg_broadcast_find_by_time
   ( struct channel *ch, time_t start, time_t stop, 
     uint16_t eid, int create, int *save );
 epg_broadcast_t *epg_broadcast_find_by_eid ( struct channel *ch, uint16_t eid );
-epg_broadcast_t *epg_broadcast_find_by_id  ( uint32_t id, struct channel *ch );
+epg_broadcast_t *epg_broadcast_find_by_id  ( uint32_t id );
 
 /* Mutators */
 int epg_broadcast_set_episode
index a56bb83ef31c94a2c5ee521acd0d6e6b2074046c..4090a3e37a59fc26ecf86602830b148781297315 100644 (file)
@@ -1067,7 +1067,7 @@ htsp_method_getEvent(htsp_connection_t *htsp, htsmsg_t *in)
     return htsp_error("Missing argument 'eventId'");
   lang = htsmsg_get_str(in, "language") ?: htsp->htsp_language;
 
-  if((e = epg_broadcast_find_by_id(eventId, NULL)) == NULL)
+  if((e = epg_broadcast_find_by_id(eventId)) == NULL)
     return htsp_error("Event does not exist");
 
   return htsp_build_event(e, NULL, lang, 0, htsp);
@@ -1092,7 +1092,7 @@ htsp_method_getEvents(htsp_connection_t *htsp, htsmsg_t *in)
     if (!(ch = channel_find_by_id(u32)))
       return htsp_error("Channel does not exist");
   if (!htsmsg_get_u32(in, "eventId", &u32))
-    if (!(e = epg_broadcast_find_by_id(u32, ch)))
+    if (!(e = epg_broadcast_find_by_id(u32)))
       return htsp_error("Event does not exist");
 
   /* Check access */
@@ -1306,7 +1306,7 @@ htsp_method_addDvrEntry(htsp_connection_t *htsp, htsmsg_t *in)
   if(!htsmsg_get_u32(in, "channelId", &u32))
     ch = channel_find_by_id(u32);
   if(!htsmsg_get_u32(in, "eventId", &eventid))
-    e = epg_broadcast_find_by_id(eventid, ch);
+    e = epg_broadcast_find_by_id(eventid);
   if(htsmsg_get_u32(in, "priority", &priority))
     priority = DVR_PRIO_NORMAL;
   if(htsmsg_get_u32(in, "retention", &retention))
index 1bf03663249a86aa4d63606b111539af460499ac..8f6d8b295713f1a0f9645ca4f1aaeb6204566211 100644 (file)
@@ -307,7 +307,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)) == NULL) {
+  if(remain == NULL || (e = epg_broadcast_find_by_id(strtoll(remain, NULL, 10))) == NULL) {
     pthread_mutex_unlock(&global_lock);
     return 404;
   }