From 12f5714c793e7c01aaeea8b9a3bb5997fd5c4f42 Mon Sep 17 00:00:00 2001 From: Aman Karmani Date: Wed, 20 Oct 2021 09:22:49 -0700 Subject: [PATCH] mark live programs with now airdate so dvr can record them --- PlutoIPTV/index.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/PlutoIPTV/index.js b/PlutoIPTV/index.js index 6b423fc..09a5172 100755 --- a/PlutoIPTV/index.js +++ b/PlutoIPTV/index.js @@ -479,13 +479,6 @@ ${m3uUrl} attrs: { system: "pluto" }, text: programme.episode.series._id, }, - { - name: "episode-num", - attrs: { system: "original-air-date" }, - text: programme.episode.clip - ? programme.episode.clip.originalReleaseDate - : null, - }, ], }; @@ -510,24 +503,37 @@ ${m3uUrl} text: programme.episode.subGenre, }) } - if (episodeNumberString && !isMovie) { + if (episodeNumberString && !isMovie && !isLive) { airing.children.push({ name: "episode-num", attrs: { system: "onscreen" }, text: episodeNumberString, }) } - if (!isMovie) { + if (!isMovie && !isLive) { airing.children.push({ name: "episode-num", attrs: { system: "pluto" }, text: programme.episode._id, }) } + + let oad = programme.episode.clip ? programme.episode.clip.originalReleaseDate : null if (isLive) { airing.children.push({ name: "live", }) + airing.children.push({ + name: "episode-num", + attrs: { system: "original-air-date" }, + text: moment(programme.start).format("YYYYMMDDHHmmss ZZ"), + }) + } else if (oad) { + airing.children.push({ + name: "episode-num", + attrs: { system: "original-air-date" }, + text: oad, + }); } let uniqueGenres = channelsGenres.filter(function (item, pos) {