Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
Jalle19 authored and perexg committed Aug 6, 2014
1 parent 3614b6c commit 6f4fc91
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions src/webui/static/app/dvr.js
Expand Up @@ -792,38 +792,14 @@ 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();
}
}

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',
Expand Down

0 comments on commit 6f4fc91

Please sign in to comment.