Parse season and episode for visionplus.id.

Signed-off-by: Toha <tohenk@yahoo.com>
This commit is contained in:
Toha
2024-11-24 17:01:19 +07:00
parent 9ab13c3583
commit f6d53587f3
4 changed files with 24 additions and 16 deletions

View File

@@ -28,10 +28,14 @@ module.exports = {
if (Array.isArray(json.evs)) {
for (const ev of json.evs) {
if (ev.sid === channel.site_id) {
const title = ev.con && ev.con.loc ? ev.con.loc[0].tit : ev.con.oti
const [, , season, , episode] = title.match(/( S(\d+))?(, Ep (\d+))/) || [null, null, null, null, null]
programs.push({
title: ev.con && ev.con.loc ? ev.con.loc[0].tit : ev.con.oti,
title,
description: ev.con && ev.con.loc ? ev.con.loc[0].syn : null,
categories: ev.con ? ev.con.categories : null,
season: season ? parseInt(season) : season,
episode: episode ? parseInt(episode) : episode,
start: dayjs(ev.sta),
stop: dayjs(ev.end)
})