mirror of https://github.com/calzoneman/sync.git
Add sanity check to prevent null duration from corrupting playlist meta
This commit is contained in:
parent
693c0e8673
commit
9c44488d8e
|
@ -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.63.0",
|
"version": "3.63.1",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
|
@ -935,6 +935,11 @@ PlaylistModule.prototype._addItem = function (media, data, user, cb) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(media.seconds)) {
|
||||||
|
LOGGER.warn("Detected NaN duration for %j", media);
|
||||||
|
return qfail("Internal error: could not determine media duration");
|
||||||
|
}
|
||||||
|
|
||||||
if (data.maxlength > 0 && media.seconds > data.maxlength) {
|
if (data.maxlength > 0 && media.seconds > data.maxlength) {
|
||||||
return qfail("Video exceeds the maximum length set by the channel admin: " +
|
return qfail("Video exceeds the maximum length set by the channel admin: " +
|
||||||
data.maxlength + " seconds");
|
data.maxlength + " seconds");
|
||||||
|
|
Loading…
Reference in New Issue