diff --git a/PlutoIPTV/index.js b/PlutoIPTV/index.js index 10196b8..2af42ed 100755 --- a/PlutoIPTV/index.js +++ b/PlutoIPTV/index.js @@ -456,11 +456,6 @@ ${m3uUrl} children: [ { name: "title", attrs: { lang: "en" }, text: programme.title }, { name: "icon", attrs: { src: airingArt } }, - { - name: "desc", - attrs: { lang: "en" }, - text: programme.episode.description, - }, { name: "date", text: moment( @@ -474,31 +469,11 @@ ${m3uUrl} attrs: { lang: "en" }, text: isMovie ? "Movie" : "Series", }, - { - name: "category", - attrs: { lang: "en" }, - text: programme.episode.genre, - }, - { - name: "category", - attrs: { lang: "en" }, - text: programme.episode.subGenre, - }, { name: "series-id", attrs: { system: "pluto" }, text: programme.episode.series._id, }, - { - name: "episode-num", - attrs: { system: "onscreen" }, - text: episodeNumberString || programme.episode.number, - }, - { - name: "episode-num", - attrs: { system: "pluto" }, - text: programme.episode._id, - }, { name: "episode-num", attrs: { system: "original-air-date" }, @@ -509,11 +484,47 @@ ${m3uUrl} ], }; + if (programme.episode.description && programme.episode.description != "No information available") { + airing.children.push({ + name: "desc", + attrs: { lang: "en" }, + text: programme.episode.description, + }) + } + if (programme.episode.genre && programme.episode.genre != "No information available") { + airing.children.push({ + name: "category", + attrs: { lang: "en" }, + text: programme.episode.genre, + }) + } + if (programme.episode.subGenre && programme.episode.subGenre != "No information available") { + airing.children.push({ + name: "category", + attrs: { lang: "en" }, + text: programme.episode.subGenre, + }) + } + if (episodeNumberString || (programme.episode.number && programme.episode.number > 0 && !isMovie)) { + airing.children.push({ + name: "episode-num", + attrs: { system: "onscreen" }, + text: episodeNumberString || programme.episode.number, + }) + } + if (!isMovie) { + airing.children.push({ + name: "episode-num", + attrs: { system: "pluto" }, + text: programme.episode._id, + }) + } + let uniqueGenres = channelsGenres.filter(function (item, pos) { return channelsGenres.indexOf(item) == pos; }); - uniqueGenres.forEach((genre) => { + uniqueGenres.forEach(genre => { airing.children.push({ name: "category", attrs: { lang: "en" },