}
static int
-api_epg_byid
+api_epg_load
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
uint32_t id = 0, entries = 0;
{ "epg/events/grid", ACCESS_ANONYMOUS, api_epg_grid, NULL },
{ "epg/events/alternative", ACCESS_ANONYMOUS, api_epg_alternative, NULL },
{ "epg/events/related", ACCESS_ANONYMOUS, api_epg_related, NULL },
- { "epg/events/byid", ACCESS_ANONYMOUS, api_epg_byid, NULL },
+ { "epg/events/load", ACCESS_ANONYMOUS, api_epg_load, NULL },
{ "epg/brand/list", ACCESS_ANONYMOUS, api_epg_brand_list, NULL },
{ "epg/content_type/list", ACCESS_ANONYMOUS, api_epg_content_type_list, NULL },
var now = new Date();
var buttons = [];
- var recording = event.dvrState.indexOf('recording') == 0;
+ var recording = event.dvrState.indexOf('recording') === 0;
+ var scheduled = event.dvrState.indexOf('scheduled') === 0;
- if (!recording) {
+ if (!recording && !scheduled) {
buttons.push(new Ext.Button({
disabled: !event.title,
handler: searchIMDB,
handler: stopDVR,
iconCls: 'stopRec',
tooltip: 'Stop recording of this program',
- text: "Stop record"
+ text: "Stop recording"
+ }));
+ }
+
+ if (scheduled) {
+ buttons.push(new Ext.Button({
+ handler: deleteDVR,
+ iconCls: 'remove',
+ tooltip: 'Delete scheduled recording of this program',
+ text: "Delete recording"
}));
}
success: function(d) {
win.close();
},
- question: 'Do you really want to abort/unschedule this event?'
+ question: 'Do you really want to abort/unschedule this recording?'
+ });
+ }
+
+ function deleteDVR() {
+ tvheadend.AjaxConfirm({
+ url: 'api/idnode/delete',
+ params: {
+ uuid: event.dvrUuid,
+ },
+ success: function(d) {
+ win.close();
+ },
+ question: 'Do you really want to remove this recording?'
});
}
tvheadend.epg = function() {
var lookup = '<span class="x-linked"> </span>';
+ var detailsfcn = function(grid, rec, act, row) {
+ new tvheadend.epgDetails(grid.getStore().getAt(row).data);
+ };
+
var actions = new Ext.ux.grid.RowActions({
id: 'details',
header: 'Details',
width: 45,
dataIndex: 'actions',
+ callbacks: {
+ 'recording': detailsfcn,
+ 'recordingError': detailsfcn,
+ 'scheduled': detailsfcn,
+ 'completed': detailsfcn,
+ 'completedError': detailsfcn,
+ },
actions: [
{
iconCls: 'broadcast_details',
qtip: 'Broadcast details',
- cb: function(grid, rec, act, row) {
- new tvheadend.epgDetails(grid.getStore().getAt(row).data);
- }
+ cb: detailsfcn,
},
- { iconIndex: 'dvrState' }
+ {
+ iconIndex: 'dvrState',
+ }
]
});
epgStore.remove(r);
}
}
- if (m.update || m.dvr_update) {
+ if (m.update || m.dvr_update || m.dvr_delete) {
+ var a = m.update || m.dvr_update || m.dvr_delete;
if (m.update && m.dvr_update)
- var a = m.update.concat(m.dvr_update);
- else
- var a = m.update || m.dvr_update;
+ var a = m.update.concat(m.dvr_update);
+ if (m.update || m.dvr_update)
+ a = a.concat(m.dvr_delete);
var ids = [];
for (var i = 0; i < a.length; i++) {
var r = epgStore.getById(a[i]);
}
if (ids) {
Ext.Ajax.request({
- url: 'api/epg/events/byid',
+ url: 'api/epg/events/load',
params: {
eventId: ids
},
r.commit();
}
}
- panel.getView().refresh();
},
failure: function(response, options) {
Ext.MessageBox.alert('EPG Update', response.statusText);