From aa06884bd6d360e58ebe3a5a59672a13c49dbe92 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Thu, 17 Nov 2016 23:00:06 -0800 Subject: [PATCH] Ignore cached metadata for youtube livestreams --- package.json | 2 +- src/channel/playlist.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 66a4bbcf..f7adb24c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.24.0", + "version": "3.24.1", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/src/channel/playlist.js b/src/channel/playlist.js index 71198070..6dbee410 100644 --- a/src/channel/playlist.js +++ b/src/channel/playlist.js @@ -470,6 +470,16 @@ PlaylistModule.prototype.queueStandard = function (user, data) { 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) { /* Don't re-cache data we got from the library */ data.shouldAddToLibrary = false;