return save;
}
+const char *
+channel_get_epgid ( channel_t *ch )
+{
+ const char *s;
+ idnode_list_mapping_t *ilm;
+ LIST_FOREACH(ilm, &ch->ch_services, ilm_in2_link)
+ if ((s = service_get_channel_epgid((service_t *)ilm->ilm_in1)))
+ return s;
+ return channel_get_name(ch);
+}
+
/* **************************************************************************
* Creation/Deletion
* *************************************************************************/
const char *channel_get_icon ( channel_t *ch );
int channel_set_icon ( channel_t *ch, const char *icon );
+const char *channel_get_epgid ( channel_t *ch );
+
#define channel_get_suuid(ch) idnode_uuid_as_sstr(&(ch)->ch_id)
#define channel_get_id(ch) idnode_get_short_uuid((&(ch)->ch_id))
if (!ec || !ch || !ch->ch_epgauto || !ch->ch_enabled) return 0;
if (LIST_FIRST(&ec->channels)) return 0; // ignore already paired
- if (ec->name && !strcmp(ec->name, channel_get_name(ch))) return 1;
+ if (ec->name && !strcmp(ec->name, channel_get_epgid(ch))) return 1;
int64_t number = channel_get_number(ch);
if ((ec->major || ec->minor) && ec->major == channel_get_major(number) && ec->minor == channel_get_minor(number)) return 1;
return 0;
const char *last_url,
const http_arg_list_t *remove_args,
const char *url, const char *name,
- const char *logo,
+ const char *logo, const char *epgid,
int64_t chnum, int *total, int *count)
{
htsmsg_t *conf;
im->mm_iptv_icon = logo ? strdup(logo) : NULL;
change = 1;
}
+ if (strcmp(im->mm_iptv_epgid ?: "", epgid ?: "")) {
+ free(im->mm_iptv_epgid);
+ im->mm_iptv_epgid = epgid ? strdup(epgid) : NULL;
+ change = 1;
+ }
if (change)
idnode_notify_changed(&im->mm_id);
(*total)++;
http_arg_list_t *remove_args,
int64_t chnum)
{
- char *url, *name = NULL, *logo = NULL;
+ char *url, *name = NULL, *logo = NULL, *epgid = NULL;
int total = 0, count = 0;
while (*data && *data != '\n') data++;
if (strncmp(data, "#EXTINF:", 8) == 0) {
name = NULL;
logo = NULL;
+ epgid = NULL;
data += 8;
while (1) {
while (*data && *data <= ' ') data++;
if (*data == ',') break;
if (strncmp(data, "tvg-logo=", 9) == 0)
logo = get_m3u_str(data + 9, &data);
+ else if (strncmp(data, "tvg-id=", 7) == 0)
+ epgid = get_m3u_str(data + 7, &data);
else if (strncmp(data, "logo=", 5) == 0)
logo = get_m3u_str(data + 5, &data);
else {
if (*data) { *data = '\0'; data++; }
if (*url)
iptv_auto_network_process_m3u_item(in, last_url, remove_args,
- url, name, logo,
+ url, name, logo, epgid,
chnum, &total, &count);
}
.name = N_("Channel number"),
.off = offsetof(iptv_mux_t, mm_iptv_chnum),
},
- {
- .type = PT_STR,
- .id = "iptv_icon",
- .name = N_("Icon URL"),
- .off = offsetof(iptv_mux_t, mm_iptv_icon),
- },
{
.type = PT_STR,
.id = "iptv_sname",
.name = N_("Service Name"),
.off = offsetof(iptv_mux_t, mm_iptv_svcname),
},
+ {
+ .type = PT_STR,
+ .id = "iptv_epgid",
+ .name = N_("EPG Name"),
+ .off = offsetof(iptv_mux_t, mm_iptv_epgid),
+ },
+ {
+ .type = PT_STR,
+ .id = "iptv_icon",
+ .name = N_("Icon URL"),
+ .off = offsetof(iptv_mux_t, mm_iptv_icon),
+ },
{
.type = PT_BOOL,
.id = "iptv_respawn",
free(im->mm_iptv_svcname);
free(im->mm_iptv_env);
free(im->mm_iptv_icon);
+ free(im->mm_iptv_epgid);
mpegts_mux_delete(mm, delconf);
free(url);
free(url_sane);
char *mm_iptv_svcname;
int64_t mm_iptv_chnum;
char *mm_iptv_icon;
+ char *mm_iptv_epgid;
int mm_iptv_respawn;
time_t mm_iptv_respawn_last;
return NULL;
}
+static const char *
+iptv_service_channel_epgid ( service_t *s )
+{
+ iptv_service_t *is = (iptv_service_t *)s;
+ iptv_mux_t *im = (iptv_mux_t *)is->s_dvb_mux;
+ return im->mm_iptv_epgid;
+}
+
/*
* Create
*/
is->s_channel_name = iptv_service_channel_name;
is->s_channel_number = iptv_service_channel_number;
is->s_channel_icon = iptv_service_channel_icon;
+ is->s_channel_epgid = iptv_service_channel_epgid;
/* Set default service name */
if (!is->s_dvb_svcname || !*is->s_dvb_svcname)
return r;
}
+/*
+ * Get EPG ID for channel from service
+ */
+const char *
+service_get_channel_epgid ( service_t *s )
+{
+ if (s->s_channel_epgid) return s->s_channel_epgid(s);
+ return NULL;
+}
+
/*
*
*/
*/
int64_t (*s_channel_number) (struct service *);
const char *(*s_channel_name) (struct service *);
+ const char *(*s_channel_epgid) (struct service *);
const char *(*s_provider_name) (struct service *);
const char *(*s_channel_icon) (struct service *);
void (*s_mapped) (struct service *);
const char *service_get_full_channel_name (service_t *s);
int64_t service_get_channel_number (service_t *s);
const char *service_get_channel_icon (service_t *s);
+const char *service_get_channel_epgid (service_t *s);
void service_mapped (service_t *s);