Ignore cached metadata for youtube livestreams

This commit is contained in:
Calvin Montgomery 2016-11-17 23:00:06 -08:00
parent 632ffdfa8f
commit aa06884bd6
2 changed files with 11 additions and 1 deletions

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.24.0", "version": "3.24.1",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },

View File

@ -470,6 +470,16 @@ PlaylistModule.prototype.queueStandard = function (user, data) {
return lock.release(); return lock.release();
} }
// YouTube livestreams transition to becoming regular videos,
// breaking the cached duration of 0.
// In the future, the media cache should be decoupled from
// the library and this will no longer be an issue, but for now
// treat 0-length yt library entries as non-existent.
if (item.type === "yt" && item.seconds === 0) {
data.type = "yt"; // Kludge -- library queue has type: "lib"
item = null;
}
if (item !== null) { if (item !== null) {
/* Don't re-cache data we got from the library */ /* Don't re-cache data we got from the library */
data.shouldAddToLibrary = false; data.shouldAddToLibrary = false;