assert(x == NULL);
- epg_add_channel(ch);
+ epg_channel_map_add(ch);
htsp_channel_add(ch);
return ch;
channel_set_name(ch, name);
- epg_add_channel(ch);
+ epg_channel_map_add(ch);
tvh_str_update(&ch->ch_icon, htsmsg_get_str(c, "icon"));
RB_REMOVE(&channel_name_tree, ch, ch_name_link);
channel_set_name(ch, newname);
- epg_mod_channel(ch);
+ epg_channel_map_mod(ch);
LIST_FOREACH(t, &ch->ch_services, s_ch_link)
t->s_config_save(t);
s->ths_channel = NULL;
}
- epg_rem_channel(ch);
+ epg_channel_map_rem(ch);
hts_settings_remove("channels/%d", ch->ch_id);
return;
ch->ch_epg_channel = ec;
+ // TODO: should I do this?
htsp_channel_update(ch); // Not sure?
}
/* Set brand */
if ((str = htsmsg_get_str(attr, "brand"))) {
if ((brand = epg_brand_find_by_uri(str, 0, NULL))) {
- save |= epg_episode_set_brand(episode, brand, 1);
+ save |= epg_episode_set_brand(episode, brand);
}
}
/* Set season */
if ((str = htsmsg_get_str(attr, "series"))) {
if ((season = epg_season_find_by_uri(str, 0, NULL))) {
- save |= epg_episode_set_season(episode, season, 1);
+ save |= epg_episode_set_season(episode, season);
}
}
if (!_pyepg_parse_time(start, &tm_start)) return 0;
if (!_pyepg_parse_time(stop, &tm_stop)) return 0;
- /* Ignore */
- if(tm_stop <= tm_start || tm_stop < dispatch_clock) return 0;
-
/* Find broadcast */
broadcast = epg_broadcast_find_by_time(channel, tm_start, tm_stop, 1, &save);
if ( broadcast == NULL ) return 0;
if ( save ) stats->broadcasts.created++;
/* Set episode */
- save |= epg_broadcast_set_episode(broadcast, episode, 1);
+ save |= epg_broadcast_set_episode(broadcast, episode);
/* TODO: extra metadata */
tvhlog(LOG_DEBUG, "pyepg", "grab %s %s", argv[0], iopts ? iopts : "");
/* Grab */
- // TODO: HACK: use static input
+#if 0
outlen = spawn_and_store_stdout(argv[0], (char *const*)argv, &outbuf);
+#else
+ outlen = spawn_and_store_stdout("/home/aps/tmp/epg.sh", NULL, &outbuf);
+#endif
free(opts);
if ( outlen < 1 ) {
tvhlog(LOG_ERR, "pyepg", "no output detected");
if ( ebc != NULL ) {
stats->broadcasts.total++;
if (save2) stats->broadcasts.created++;
- save2 |= epg_broadcast_set_episode(ebc, ee, 1);
+ save2 |= epg_broadcast_set_episode(ebc, ee);
if (save2) stats->broadcasts.modified++;
}
if(htsmsg_get_u32(in, "numFollowing", &numFollowing))
return htsp_error("Missing argument 'numFollowing'");
- if((e = epg_broadcast_find_by_id(eventid)) == NULL) {
+ if((e = epg_broadcast_find_by_id(eventid, NULL)) == NULL) {
return htsp_error("Event does not exist");
}
if(htsmsg_get_u32(in, "eventId", &eventid))
return htsp_error("Missing argument 'eventId'");
- if((e = epg_broadcast_find_by_id(eventid)) == NULL)
+ if((e = epg_broadcast_find_by_id(eventid, NULL)) == NULL)
return htsp_error("Event does not exist");
out = htsp_build_event(e);
pthread_mutex_lock(&global_lock);
if ( id && type ) {
- e = epg_broadcast_find_by_id(atoi(id));
+ e = epg_broadcast_find_by_id(atoi(id), NULL);
if ( e && e->episode ) {
ee = e->episode;
pthread_mutex_lock(&global_lock);
- if(remain == NULL || (e = epg_broadcast_find_by_id(atoi(remain))) == NULL) {
+ if(remain == NULL || (e = epg_broadcast_find_by_id(atoi(remain), NULL)) == NULL) {
pthread_mutex_unlock(&global_lock);
return 404;
}