Update error messages caught by mediarefresher

This commit is contained in:
Calvin Montgomery 2015-07-08 13:27:43 -07:00
parent cb52148b2f
commit b2687f49a8
2 changed files with 30 additions and 13 deletions

View File

@ -96,12 +96,25 @@ MediaRefresherModule.prototype.refreshGoogleDocs = function (media, cb) {
return; return;
} }
err = err.replace(/Google Drive lookup failed: /, "");
err = err.replace(/Forbidden/, "Access Denied");
err = err.replace(/You don't have permission to access this video\./,
"Access Denied");
switch (err) { switch (err) {
case "HTTP 302": case "Moved Temporarily":
case "Video not found": self.channel.logger.log("[mediarefresher] Google Docs refresh failed " +
case "Private video": "(likely redirect to login page-- make sure it is shared " +
case "Google Docs error: Video has exceeded quota": "correctly)");
case "There is currently a bug with Google Drive which prevents playback of videos 1 hour long or longer.": self.channel.activeLock.release();
if (cb) cb();
return;
case "Access Denied":
case "Not Found":
case "Internal Server Error":
case "Service Unavailable":
case "Google Drive does not permit videos longer than 1 hour to be played":
case "Google Drive videos must be shared publicly":
self.channel.logger.log("[mediarefresher] Google Docs refresh failed: " + self.channel.logger.log("[mediarefresher] Google Docs refresh failed: " +
err); err);
self.channel.activeLock.release(); self.channel.activeLock.release();
@ -146,14 +159,18 @@ MediaRefresherModule.prototype.initGooglePlus = function (media, cb) {
return; return;
} }
err = err.replace(/Forbidden/, "Access Denied");
switch (err) { switch (err) {
case "HTTP 302": case "Access Denied":
case "Video not found": case "Not Found":
case "Private video": case "Internal Server Error":
case "The video is still being processed.": case "Service Unavailable":
case "A processing error has occured and the video should be deleted.": case "The video is still being processed":
case "The video has been processed but still needs a thumbnail.": case "A processing error has occured":
case "Unable to retreive duration from Google+. This might be because the video is still processing.": case "The video has been processed but is not yet accessible":
case ("Unable to retreive video information. Check that the video exists " +
"and is shared publicly"):
self.channel.logger.log("[mediarefresher] Google+ refresh failed: " + self.channel.logger.log("[mediarefresher] Google+ refresh failed: " +
err); err);
self.channel.activeLock.release(); self.channel.activeLock.release();

View File

@ -2,7 +2,7 @@
"author": "Calvin Montgomery", "author": "Calvin Montgomery",
"name": "CyTube", "name": "CyTube",
"description": "Online media synchronizer and chat", "description": "Online media synchronizer and chat",
"version": "3.8.1", "version": "3.8.2",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },