diff --git a/src/api/api_dvr.c b/src/api/api_dvr.c index e1e781bf..8d8185b0 100644 --- a/src/api/api_dvr.c +++ b/src/api/api_dvr.c @@ -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"); diff --git a/src/api/api_epg.c b/src/api/api_epg.c index fd47017f..54a95fb1 100644 --- a/src/api/api_epg.c +++ b/src/api/api_epg.c @@ -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) { diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index cf364eed..2764c50c 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -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, diff --git a/src/epg.c b/src/epg.c index 38d63797..5d378387 100644 --- 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); } diff --git a/src/epg.h b/src/epg.h index 340a23f4..c639bf47 100644 --- 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 diff --git a/src/htsp_server.c b/src/htsp_server.c index a56bb83e..4090a3e3 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -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)) diff --git a/src/webui/simpleui.c b/src/webui/simpleui.c index 1bf03663..8f6d8b29 100644 --- a/src/webui/simpleui.c +++ b/src/webui/simpleui.c @@ -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; }