I would like to add an option that allows users to whitelist CAID's in the bouquet mapper.
- If the list is empty, then map any CAID (same functionality as now)
- If there are any values set, map only those values
As a complete novice, I'd like to know how to go about this and where to start.
I have some experience with Python but none at all in C.
If someone could walk me through setting up VSC, that would be fantastic (I have lots of underlines/errors)
It looks like this is what I need to edit to achieve my goal (ignoring the UI/config stuff that I haven't looked into yet)?
static void
bouquet_map_channel(bouquet_t *bq, service_t *t)
{
channel_t *ch = NULL;
idnode_list_mapping_t *ilm;
static service_mapper_conf_t sm_conf = {
.check_availability = 0,
.encrypted = 1,
.merge_same_name = 0,
.merge_same_name_fuzzy = 0,
.tidy_channel_name = 0,
.type_tags = 0,
.provider_tags = 0,
.network_tags = 0
};
if (!t->s_enabled)
return;
if (!bq->bq_mapradio && service_is_radio(t))
return;
if (!bq->bq_mapnolcn &&
bouquet_get_channel_number(bq, t) <= 0)
return;
if (!bq->bq_mapnoname && noname(service_get_channel_name(t)))
return;
if (!bq->bq_mapencrypted && service_is_encrypted(t))
return;
LIST_FOREACH(ilm, &t->s_channels, ilm_in1_link)
if (((channel_t *)ilm->ilm_in2)->ch_bouquet == bq)
break;
if (!ilm) {
sm_conf.encrypted = bq->bq_mapencrypted;
sm_conf.merge_same_name = bq->bq_mapmergename;
sm_conf.merge_same_name_fuzzy = bq->bq_mapmergefuzzy;
sm_conf.tidy_channel_name = bq->bq_tidychannelname;
sm_conf.type_tags = bq->bq_chtag_type_tags;
sm_conf.provider_tags = bq->bq_chtag_provider_tags;
sm_conf.network_tags = bq->bq_chtag_network_tags;
ch = service_mapper_process(&sm_conf, t, bq);
} else
ch = (channel_t *)ilm->ilm_in2;
if (ch && bq->bq_chtag)
if (channel_tag_map(bouquet_tag(bq, 1), ch, ch))
idnode_changed(&ch->ch_id);
}
Any help is appreciated.