Add content group and comment to auto recording.

This commit is contained in:
Andreas Öman 2008-09-24 17:02:21 +00:00
parent 2f81c7851f
commit 70d013295b
3 changed files with 49 additions and 21 deletions

View file

@ -42,6 +42,7 @@ typedef struct dvr_autorec_entry {
int dae_enabled;
char *dae_creator;
char *dae_comment;
char *dae_title;
regex_t dae_title_preg;
@ -139,6 +140,7 @@ autorec_entry_destroy(dvr_autorec_entry_t *dae)
free(dae->dae_id);
free(dae->dae_creator);
free(dae->dae_comment);
if(dae->dae_title != NULL) {
free(dae->dae_title);
@ -166,13 +168,20 @@ autorec_record_build(dvr_autorec_entry_t *dae)
htsmsg_add_str(e, "id", dae->dae_id);
htsmsg_add_u32(e, "enabled", !!dae->dae_enabled);
htsmsg_add_str(e, "creator", dae->dae_creator ?: "");
if(dae->dae_channel)
htsmsg_add_str(e, "channel",
dae->dae_channel ? dae->dae_channel->ch_name : "");
if(dae->dae_channel_tag)
htsmsg_add_str(e, "channeltag",
dae->dae_channel_tag ? dae->dae_channel_tag->ct_name : "");
if(dae->dae_creator != NULL)
htsmsg_add_str(e, "creator", dae->dae_creator);
if(dae->dae_comment != NULL)
htsmsg_add_str(e, "comment", dae->dae_comment);
htsmsg_add_str(e, "channel",
dae->dae_channel ? dae->dae_channel->ch_name : "");
htsmsg_add_str(e, "tag",
dae->dae_channel_tag ? dae->dae_channel_tag->ct_name : "");
htsmsg_add_str(e, "contentgrp",
dae->dae_ecg ? dae->dae_ecg->ecg_name : "");
htsmsg_add_str(e, "title", dae->dae_title ?: "");
return e;
@ -233,6 +242,7 @@ autorec_record_update(void *opaque, const char *id, htsmsg_t *values,
return NULL;
tvh_str_set(&dae->dae_creator, htsmsg_get_str(values, "creator"));
tvh_str_set(&dae->dae_comment, htsmsg_get_str(values, "comment"));
if((s = htsmsg_get_str(values, "channel")) != NULL) {
if(dae->dae_channel != NULL) {
@ -258,7 +268,7 @@ autorec_record_update(void *opaque, const char *id, htsmsg_t *values,
}
}
if((s = htsmsg_get_str(values, "channeltag")) != NULL) {
if((s = htsmsg_get_str(values, "tag")) != NULL) {
if(dae->dae_channel_tag != NULL) {
LIST_REMOVE(dae, dae_channel_tag_link);
dae->dae_channel_tag = NULL;
@ -269,6 +279,9 @@ autorec_record_update(void *opaque, const char *id, htsmsg_t *values,
}
}
if((s = htsmsg_get_str(values, "contentgrp")) != NULL)
dae->dae_ecg = epg_content_group_find_by_name(s);
return autorec_record_build(dae);
}

View file

@ -194,7 +194,7 @@ tvheadend.autoreceditor = function() {
var enabledColumn = new Ext.grid.CheckColumn({
header: "Enabled",
dataIndex: 'enabled',
width: 60
width: 30
});
var cm = new Ext.grid.ColumnModel([
@ -202,14 +202,12 @@ tvheadend.autoreceditor = function() {
{
header: "Title (Regexp)",
dataIndex: 'title',
width: 200,
editor: new fm.TextField({allowBlank: true})
},{
header: "Channel",
dataIndex: 'channel',
editor: new Ext.form.ComboBox({
loadingText: 'Loading...',
width: 200,
displayField:'name',
store: tvheadend.channels,
mode: 'local',
@ -219,7 +217,7 @@ tvheadend.autoreceditor = function() {
})
},{
header: "Channel tag",
dataIndex: 'channeltag',
dataIndex: 'tag',
editor: new Ext.form.ComboBox({
displayField:'name',
store: tvheadend.channelTags,
@ -228,15 +226,31 @@ tvheadend.autoreceditor = function() {
triggerAction: 'all',
emptyText: 'Only include tag...'
})
},{
header: "Content Group",
dataIndex: 'contentgrp',
editor: new Ext.form.ComboBox({
displayField:'name',
store: tvheadend.ContentGroupStore,
mode: 'local',
editable: false,
triggerAction: 'all',
emptyText: 'Only include content...'
})
},{
header: "Creator",
dataIndex: 'creator',
editor: new fm.TextField({allowBlank: false})
},{
header: "Comment",
dataIndex: 'comment',
editor: new fm.TextField({allowBlank: false})
}
]);
var rec = Ext.data.Record.create([
'enabled','title','channel','channeltag','creator'
'enabled','title','channel','tag','creator','contentgrp','comment'
]);
return new tvheadend.tableEditor('Automatic Recorder',

View file

@ -1,3 +1,10 @@
tvheadend.ContentGroupStore = new Ext.data.JsonStore({
root:'entries',
fields: [{name: 'name'}],
autoLoad: true,
url:'ecglist',
});
tvheadend.epgDetails = function(event) {
@ -173,19 +180,13 @@ tvheadend.epg = function() {
// Content groups
var epgFilterContentGroupStore = new Ext.data.JsonStore({
root:'entries',
fields: [{name: 'name'}],
url:'ecglist',
});
var epgFilterContentGroup = new Ext.form.ComboBox({
loadingText: 'Loading...',
width: 200,
displayField:'name',
store: epgFilterContentGroupStore,
mode: 'remote',
store: tvheadend.ContentGroupStore,
mode: 'local',
editable: false,
triggerAction: 'all',
emptyText: 'Only include content...'