Crash fix
This commit is contained in:
parent
0102b92730
commit
8152008466
2 changed files with 9 additions and 2 deletions
|
|
@ -1039,6 +1039,7 @@ PlaylistModule.prototype.startPlayback = function (time) {
|
|||
if (media.type === "gd") {
|
||||
this._gdRefreshTimer = setInterval(this.refreshGoogleDocs.bind(this), 3600000);
|
||||
if (media.meta.expiration && media.meta.expiration < Date.now() + 3600000) {
|
||||
var self = this;
|
||||
setTimeout(this.refreshGoogleDocs.bind(this), media.meta.expiration - Date.now());
|
||||
}
|
||||
}
|
||||
|
|
@ -1086,6 +1087,11 @@ PlaylistModule.prototype._leadLoop = function() {
|
|||
|
||||
PlaylistModule.prototype.refreshGoogleDocs = function (cb) {
|
||||
var self = this;
|
||||
|
||||
if (self.dead || !self.channel || self.channel.dead) {
|
||||
return;
|
||||
}
|
||||
|
||||
var abort = function () {
|
||||
clearInterval(self._gdRefreshTimer);
|
||||
self._gdRefreshTimer = false;
|
||||
|
|
@ -1111,7 +1117,9 @@ PlaylistModule.prototype.refreshGoogleDocs = function (cb) {
|
|||
self.current.media.meta.object = self.current.media.meta.object || null;
|
||||
self.current.media.meta.failed = true;
|
||||
}
|
||||
cb && cb();
|
||||
if (cb) {
|
||||
cb();
|
||||
}
|
||||
self.channel.activeLock.release();
|
||||
} else {
|
||||
if (!self.current || self.current.media.type !== "gd") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue