Skip to content

Commit

Permalink
avoid injecting episode ids for movies; skip unavailable descriptions…
Browse files Browse the repository at this point in the history
… and genres
  • Loading branch information
tmm1 committed Oct 19, 2021
1 parent 094873d commit 27d99e6
Showing 1 changed file with 37 additions and 26 deletions.
63 changes: 37 additions & 26 deletions PlutoIPTV/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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" },
Expand All @@ -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" },
Expand Down

0 comments on commit 27d99e6

Please sign in to comment.