#define DVR_UPDATED_EID (1<<14)
#define DVR_UPDATED_BROADCAST (1<<15)
#define DVR_UPDATED_EPISODE (1<<16)
+#define DVR_UPDATED_CONFIG (1<<17)
static char *dvr_updated_str(char *buf, size_t buflen, int flags)
{
- static const char *x = "ecoOsStumdpgrviBE";
+ static const char *x = "ecoOsStumdpgrviBEC";
const char *p = x;
char *w = buf, *end = buf + buflen;
*
*/
static dvr_entry_t *_dvr_entry_update
- ( dvr_entry_t *de, int enabled, epg_broadcast_t *e, channel_t *ch,
+ ( dvr_entry_t *de, int enabled, const char *dvr_config_uuid,
+ epg_broadcast_t *e, channel_t *ch,
const char *title, const char *subtitle, const char *desc,
const char *lang, time_t start, time_t stop,
time_t start_extra, time_t stop_extra,
goto dosave;
}
+ /* Configuration */
+ if (dvr_config_uuid) {
+ de->de_config = dvr_config_find_by_name_default(dvr_config_uuid);
+ save |= DVR_UPDATED_CONFIG;
+ }
+
/* Channel */
if (ch && (ch != de->de_channel)) {
de->de_channel = ch;
*/
dvr_entry_t *
dvr_entry_update
- ( dvr_entry_t *de, int enabled, channel_t *ch,
+ ( dvr_entry_t *de, int enabled,
+ const char *dvr_config_uuid, channel_t *ch,
const char *title, const char *subtitle,
const char *desc, const char *lang,
time_t start, time_t stop,
time_t start_extra, time_t stop_extra,
dvr_prio_t pri, int retention, int removal )
{
- return _dvr_entry_update(de, enabled, NULL, ch, title, subtitle, desc, lang,
+ return _dvr_entry_update(de, enabled, dvr_config_uuid,
+ NULL, ch, title, subtitle, desc, lang,
start, stop, start_extra, stop_extra,
pri, retention, removal);
}
epg_broadcast_get_title(e2, NULL),
channel_get_name(ch),
e2->start, e2->stop);
- _dvr_entry_update(de, -1, e2, NULL, NULL, NULL, NULL, NULL,
+ _dvr_entry_update(de, -1, NULL, e2, NULL, NULL, NULL, NULL, NULL,
0, 0, 0, 0, DVR_PRIO_NOTSET, 0, 0);
return;
}
LIST_FOREACH(de, &e->channel->ch_dvrs, de_channel_link) {
if (de->de_bcast != e)
continue;
- _dvr_entry_update(de, -1, e, NULL, NULL, NULL, NULL,
+ _dvr_entry_update(de, -1, NULL, e, NULL, NULL, NULL, NULL,
NULL, 0, 0, 0, 0, DVR_PRIO_NOTSET, 0, 0);
found++;
}
epg_broadcast_get_title(e, NULL),
channel_get_name(e->channel),
e->start, e->stop);
- _dvr_entry_update(de, -1, e, NULL, NULL, NULL, NULL,
+ _dvr_entry_update(de, -1, NULL, e, NULL, NULL, NULL, NULL,
NULL, 0, 0, 0, 0, DVR_PRIO_NOTSET, 0, 0);
break;
}
htsmsg_add_str(conf, "config_name", str ?: "");
htsmsg_add_str(conf, "owner", htsp->htsp_granted_access->aa_username ?: "");
htsmsg_add_str(conf, "creator", htsp->htsp_granted_access->aa_representative ?: "");
+ } else {
+ str = htsmsg_get_str(in, "configName");
+ if (str) {
+ str = htsp_dvr_config_name(htsp, str);
+ htsmsg_add_str(conf, "config_name", str ?: "");
+ }
}
/* Weekdays only if present */
uint32_t u32;
dvr_entry_t *de;
time_t start, stop, start_extra, stop_extra, priority, retention, removal;
- const char *title, *subtitle, *desc, *lang;
+ const char *dvr_config_name, *title, *subtitle, *desc, *lang;
channel_t *channel = NULL;
int enabled;
return htsp_error("User does not have access to channel");
enabled = htsmsg_get_s64_or_default(in, "enabled", -1);
+ dvr_config_name = htsp_dvr_config_name(htsp, htsmsg_get_str(in, "configName"));
start = htsmsg_get_s64_or_default(in, "start", 0);
stop = htsmsg_get_s64_or_default(in, "stop", 0);
start_extra = htsmsg_get_s64_or_default(in, "startExtra", 0);
desc = htsmsg_get_str(in, "description");
lang = htsmsg_get_str(in, "language") ?: htsp->htsp_language;
- de = dvr_entry_update(de, enabled, channel, title, subtitle, desc, lang, start, stop,
- start_extra, stop_extra, priority, retention, removal);
+ de = dvr_entry_update(de, enabled, dvr_config_name, channel, title, subtitle,
+ desc, lang, start, stop, start_extra, stop_extra,
+ priority, retention, removal);
return htsp_success();
}