htsp_method_getDvrConfigs(htsp_connection_t *htsp, htsmsg_t *in)
{
htsmsg_t *out, *l, *c;
+ htsmsg_field_t *f;
dvr_config_t *cfg;
+ const char *uuid, *s;
l = htsmsg_create_list();
LIST_FOREACH(cfg, &dvrconfigs, config_link)
if (cfg->dvr_enabled) {
+ uuid = idnode_uuid_as_str(&cfg->dvr_id);
+ if (htsp->htsp_granted_access->aa_dvrcfgs) {
+ HTSMSG_FOREACH(f, htsp->htsp_granted_access->aa_dvrcfgs) {
+ if (!(s = htsmsg_field_get_str(f)))
+ continue;
+ if (strcmp(s, uuid) == 0)
+ break;
+ }
+ if (f == NULL)
+ continue;
+ }
c = htsmsg_create_map();
htsmsg_add_str(c, "uuid", idnode_uuid_as_str(&cfg->dvr_id));
- htsmsg_add_str(c, "name", cfg->dvr_config_name);
- htsmsg_add_str(c, "comment", cfg->dvr_comment);
+ htsmsg_add_str(c, "name", cfg->dvr_config_name ?: "");
+ htsmsg_add_str(c, "comment", cfg->dvr_comment ?: "");
htsmsg_add_msg(l, NULL, c);
}
htsmsg_t *out, *l;
l = htsmsg_create_list();
- profile_get_htsp_list(l);
+ profile_get_htsp_list(l, htsp->htsp_granted_access->aa_profiles);
out = htsmsg_create_map();
*
*/
void
-profile_get_htsp_list(htsmsg_t *array)
+profile_get_htsp_list(htsmsg_t *array, htsmsg_t *filter)
{
profile_t *pro;
htsmsg_t *m;
+ htsmsg_field_t *f;
+ const char *uuid, *s;
TAILQ_FOREACH(pro, &profiles, pro_link) {
if (pro->pro_work) {
+ uuid = idnode_uuid_as_str(&pro->pro_id);
+ if (filter) {
+ HTSMSG_FOREACH(f, filter) {
+ if (!(s = htsmsg_field_get_str(f)))
+ continue;
+ if (strcmp(s, uuid) == 0)
+ break;
+ }
+ if (f == NULL)
+ continue;
+ }
m = htsmsg_create_map();
- htsmsg_add_str(m, "uuid", idnode_uuid_as_str(&pro->pro_id));
+ htsmsg_add_str(m, "uuid", uuid);
htsmsg_add_str(m, "name", pro->pro_name ?: "");
htsmsg_add_str(m, "comment", pro->pro_comment ?: "");
htsmsg_add_msg(array, NULL, m);
static inline muxer_container_type_t profile_get_mc(profile_t *pro)
{ return pro->pro_get_mc(pro); }
-void profile_get_htsp_list(htsmsg_t *array);
+void profile_get_htsp_list(htsmsg_t *array, htsmsg_t *filter);
void profile_init(void);
void profile_done(void);