epg: remove unused argument for epg_broadcast_find_by_id(), replace atoi() with strtoll() for 32-bit numbers

This commit is contained in:
Jaroslav Kysela 2014-10-05 21:21:47 +02:00
parent 67f5e8477d
commit e993fc6d8a
7 changed files with 12 additions and 14 deletions

View 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");

View 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) {

View 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,

View file

@ -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);
}

View file

@ -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

View 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))

View 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;
}