Minor fix

This commit is contained in:
Calvin Montgomery 2014-07-12 18:39:48 -07:00
parent b6a1dd8cb3
commit c213eb2f31
1 changed files with 12 additions and 0 deletions

View File

@ -52,6 +52,10 @@ MediaRefresherModule.prototype.initVimeo = function (data, cb) {
var self = this;
self.channel.activeLock.lock();
InfoGetter.vimeoWorkaround(data.id, function (hack) {
if (self.dead || self.channel.dead) {
return;
}
if (self._media === data) {
self.channel.logger.log("[mediarefresher] Refreshed vimeo video with ID " +
data.id);
@ -72,15 +76,23 @@ MediaRefresherModule.prototype.refreshGoogleDocs = function (media, cb) {
self.channel.activeLock.lock();
InfoGetter.getMedia(media.id, "gd", function (err, data) {
if (self.dead || self.channel.dead) {
return;
}
switch (err) {
case "HTTP 302":
case "Video not found":
case "Private video":
self.channel.logger.log("[mediarefresher] Google Docs refresh failed: " +
err);
self.channel.activeLock.release();
if (cb) cb();
return;
default:
if (err) {
self.channel.logger.log("[mediarefresher] Google Docs refresh failed: " +
err);
Logger.errlog.log("Google Docs refresh failed for ID " + media.id +
": " + err);
self.channel.activeLock.release();