Add support for subcategory in guidatv.sky.it

Proposed fix for #690
This commit is contained in:
Michele Castellaneta
2022-04-04 14:51:04 +02:00
committed by GitHub
parent b38379afb7
commit 597c0d4bdd

View File

@@ -17,7 +17,7 @@ module.exports = {
programs.push({
title: item.eventTitle,
description: item.eventSynopsis,
category: item.content.genre.name,
category: parseCategory(item),
season: item.content.seasonNumber || null,
episode: item.content.episodeNumber || null,
start: parseStart(item),
@@ -30,6 +30,15 @@ module.exports = {
}
}
function parseCategory(item) {
let category = item.content.genre.name || null;
const subcategory = item.content.subgenre.name || null;
if(category && subcategory){
category += `/${subcategory}`;
}
return category;
}
function parseStart(item) {
return item.starttime ? dayjs(item.starttime) : null
}