var now = new Date();
var buttons = [];
+ var recording = event.dvrState.indexOf('recording') == 0;
+
+ if (!recording) {
+ buttons.push(new Ext.Button({
+ disabled: !event.title,
+ handler: searchIMDB,
+ iconCls: 'find',
+ tooltip: 'Search IMDB (for title)',
+ text: "Search IMDB"
+ }));
+ }
+
+ buttons.push(new Ext.Button({
+ disabled: event.start > now || event.stop < now,
+ handler: playProgram,
+ iconCls: 'control_play',
+ tooltip: 'Play this program',
+ text: "Play program"
+ }));
if (tvheadend.accessUpdate.dvr) {
});
store.load();
- buttons.push(new Ext.Button({
- disabled: !event.title,
- handler: searchIMDB,
- iconCls: 'find',
- tooltip: 'Search IMDB (for title)',
- text: "Search IMDB"
- }));
+ if (recording) {
+ buttons.push(new Ext.Button({
+ handler: stopDVR,
+ iconCls: 'cancel',
+ tooltip: 'Stop recording of this program',
+ text: "Stop DVR"
+ }));
+ }
- buttons.push(new Ext.Button({
- disabled: event.start > now || event.stop < now,
- handler: playProgram,
- iconCls: 'control_play',
- tooltip: 'Play this program',
- text: "Play program"
- }));
-
var confcombo = new Ext.form.ComboBox({
store: store,
triggerAction: 'all',
handler: recordEvent,
iconCls: 'rec',
tooltip: 'Record now this program',
- text: "Record program"
+ text: 'Record program'
}));
buttons.push(new Ext.Button({
handler: recordSeries,
handler: function() { win.close(); },
text: "Close"
}));
+
}
var win = new Ext.Window({
record('api/dvr/autorec/create_by_series');
}
+ function stopDVR() {
+ tvheadend.AjaxConfirm({
+ url: 'api/idnode/delete',
+ params: {
+ uuid: event.dvrUuid,
+ },
+ success: function(d) {
+ win.close();
+ }
+ });
+ }
+
function record(url) {
Ext.Ajax.request({
url: url,
{ name: 'starRating' },
{ name: 'ageRating' },
{ name: 'genre' },
+ { name: 'dvrUuid' },
{ name: 'dvrState' },
{ name: 'serieslinkId' }
])