Gracefully handle elements with null duration during user playlist save
This commit is contained in:
parent
b09346392e
commit
33294278ad
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue