Gracefully handle elements with null duration during user playlist save

This commit is contained in:
Calvin Montgomery 2014-11-27 08:53:03 -06:00
parent b09346392e
commit 33294278ad

View file

@ -404,14 +404,14 @@ module.exports.saveUserPlaylist = function (pl, username, plname, callback) {
var e = { var e = {
id: pl[i].media.id, id: pl[i].media.id,
title: pl[i].media.title, title: pl[i].media.title,
seconds: pl[i].media.seconds, seconds: pl[i].media.seconds || 0,
type: pl[i].media.type, type: pl[i].media.type,
meta: { meta: {
codec: pl[i].media.meta.codec, codec: pl[i].media.meta.codec,
bitrate: pl[i].media.meta.bitrate bitrate: pl[i].media.meta.bitrate
} }
}; };
time += pl[i].media.seconds; time += pl[i].media.seconds || 0;
tmp.push(e); tmp.push(e);
} }
var count = tmp.length; var count = tmp.length;