[webui] update all DVR stores on "dvrdb" notifications

This way a finished/aborted recording correctly appears in the corresponding
tab without having to reload the page
This commit is contained in:
Sam Stenvall 2014-08-05 11:31:06 +03:00 committed by Jaroslav Kysela
parent 3614b6c93b
commit 6f4fc91fef

View file

@ -792,15 +792,6 @@ tvheadend.dvr = function() {
tvheadend.dvrStoreFailed];
function updateDvrStore(store, r, m) {
r.data.status = m.status;
r.data.schedstate = m.schedstate;
store.afterEdit(r);
store.fireEvent('updated', store, r,
Ext.data.Record.COMMIT);
}
function reloadStores() {
for (var i = 0; i < tvheadend.dvrStores.length; i++) {
tvheadend.dvrStores[i].reload();
@ -808,22 +799,7 @@ tvheadend.dvr = function() {
}
tvheadend.comet.on('dvrdb', function(m) {
if (m.reload != null) {
reloadStores();
}
if (m.updateEntry != null) {
for (var i = 0; i < tvheadend.dvrStores.length; i++) {
var store = tvheadend.dvrStores[i];
r = tvheadend.dvrStoreUpcoming.getById(m.id);
if (typeof r !== 'undefined') {
updateDvrStore(store, r, m);
return;
}
}
reloadStores();
}
reloadStores();
});
tvheadend.autorecRecord = Ext.data.Record.create(['enabled', 'title',