diff --git a/lib/database.js b/lib/database.js index bb4e24b5..1faecbac 100644 --- a/lib/database.js +++ b/lib/database.js @@ -404,14 +404,14 @@ module.exports.saveUserPlaylist = function (pl, username, plname, callback) { var e = { id: pl[i].media.id, title: pl[i].media.title, - seconds: pl[i].media.seconds, + seconds: pl[i].media.seconds || 0, type: pl[i].media.type, meta: { codec: pl[i].media.meta.codec, bitrate: pl[i].media.meta.bitrate } }; - time += pl[i].media.seconds; + time += pl[i].media.seconds || 0; tmp.push(e); } var count = tmp.length;