Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
service mapper: Add per network tags
  • Loading branch information
TheUlpio authored and perexg committed Jul 3, 2015
1 parent 6380459 commit 51f4b17
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/api/api_service.c
Expand Up @@ -42,6 +42,7 @@ api_mapper_start
get_u32(encrypted);
get_u32(merge_same_name);
get_u32(provider_tags);
get_u32(network_tags);

pthread_mutex_lock(&global_lock);
service_mapper_start(&conf, uuids);
Expand Down
7 changes: 7 additions & 0 deletions src/service_mapper.c
Expand Up @@ -255,6 +255,13 @@ service_mapper_process ( service_t *s, bouquet_t *bq )
if ((prov = s->s_provider_name(s)))
channel_tag_map(channel_tag_find_by_name(prov, 1), chn, chn);

/* Network */
if (service_mapper_conf.network_tags) {
source_info_t si;
s->s_setsourceinfo(s, &si);
channel_tag_map(channel_tag_find_by_name(si.si_network, 1), chn, chn);
}

/* save */
idnode_notify_changed(&chn->ch_id);
channel_save(chn);
Expand Down
1 change: 1 addition & 0 deletions src/service_mapper.h
Expand Up @@ -27,6 +27,7 @@ typedef struct service_mapper_conf
int encrypted; ///< Include encrypted services
int merge_same_name; ///< Merge entries with the same name
int provider_tags; ///< Create tags based on provider name
int network_tags; ///< Create tags based on network name (useful for multi adapter equipments)
} service_mapper_conf_t;

typedef struct service_mapper_status
Expand Down
7 changes: 6 additions & 1 deletion src/webui/static/app/servicemapper.js
Expand Up @@ -105,9 +105,14 @@ tvheadend.service_mapper = function(t, e, store, select)
fieldLabel: _('Create provider tags'),
checked: false
});
var nettagCheck = new Ext.form.Checkbox({
name: 'network_tags',
fieldLabel: _('Create network tags'),
checked: false
});

// TODO: provider list
items = [availCheck, ftaCheck, mergeCheck, provtagCheck];
items = [availCheck, ftaCheck, mergeCheck, provtagCheck, nettagCheck];

/* Form */
var undoBtn = new Ext.Button({
Expand Down

1 comment on commit 51f4b17

@bluzee
Copy link
Contributor

@bluzee bluzee commented on 51f4b17 Jul 4, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks so much.

Please sign in to comment.