int epggrab_ota_set_cron ( const char *cron, int lock );
int epggrab_ota_set_timeout ( uint32_t e );
int epggrab_ota_set_initial ( uint32_t e );
+void epggrab_ota_trigger ( int secs );
/*
* Load/Save
}
}
+void
+epggrab_ota_trigger ( int secs )
+{
+ /* notify another system layers, that we will do EPG OTA */
+ secs = MIN(1, MAX(secs, 7*24*3600));
+ dbus_emit_signal_s64("/epggrab/ota", "next", time(NULL) + secs);
+ epggrab_ota_pending_flag = 1;
+ epggrab_ota_kick(secs);
+}
+
void
epggrab_ota_post ( void )
{
/* Init timer (call after full init - wait for network tuners) */
if (epggrab_ota_initial) {
- /* notify another system layers, that we will do EPG OTA */
- dbus_emit_signal_s64("/epggrab/ota", "next", time(NULL) + 15);
- epggrab_ota_pending_flag = 1;
- epggrab_ota_kick(15);
+ epggrab_ota_trigger(15);
t = time(NULL);
}
out = htsmsg_create_map();
htsmsg_add_u32(out, "success", 1);
+ /* OTA EPG trigger */
+ } else if (!strcmp(op, "otaepgTrigger") ) {
+
+ str = http_arg_get(&hc->hc_req_args, "after");
+ if (!str)
+ return HTTP_STATUS_BAD_REQUEST;
+
+ pthread_mutex_lock(&global_lock);
+ epggrab_ota_trigger(atoi(str));
+ pthread_mutex_unlock(&global_lock);
+ out = htsmsg_create_map();
+ htsmsg_add_u32(out, "success", 1);
+
} else {
return HTTP_STATUS_BAD_REQUEST;
}
var helpButton = new Ext.Button({
text: 'Help',
- iconCls: 'help',
+ iconCls: 'help',
handler: function() {
new tvheadend.help('General Configuration', 'config_misc.html');
}
baseParams: {
op: 'channelList'
},
- fields: ['id', 'mod', 'name', 'icon', 'number', 'channel', 'mod-id',
- 'mod-name']
+ fields: ['id', 'mod', 'name', 'icon', 'number', 'channel', 'mod-id', 'mod-name']
});
tvheadend.epggrab = function(panel, index) {
handler: saveChanges
});
+ var otaepgButton = new Ext.Button({
+ text: "Trigger OTA EPG Grabber",
+ tooltip: 'Tune over-the-air EPG muxes to grab new events now',
+ iconCls: 'find',
+ handler: otaepgTrigger
+ });
+
var helpButton = new Ext.Button({
text: 'Help',
iconCls: 'help',
defaultType: 'textfield',
autoHeight: true,
items: [simplePanel, internalPanel, otaPanel, externalPanel],
- tbar: [saveButton, '->', helpButton]
+ tbar: [saveButton, otaepgButton, '->', helpButton]
});
/* ****************************************************************
});
}
+ function otaepgTrigger() {
+ Ext.Ajax.request({
+ url: 'epggrab',
+ params: {
+ op: 'otaepgTrigger',
+ after: 1,
+ },
+ waitMsg: 'Triggering...',
+ failure: function(response, options) {
+ Ext.Msg.alert('Trigger failed', response.statusText);
+ }
+ });
+ }
+
tvheadend.paneladd(panel, confpanel, index);
};