Fix xmltv date bug with some time zones. Improve error message when it's not possible to call plex DVRs endpoint

This commit is contained in:
vexorian 2020-07-06 17:37:55 -04:00
parent 0ffc9737c4
commit f36b4a13f0
2 changed files with 4 additions and 10 deletions

View File

@ -54,7 +54,9 @@ let xmltvInterval = {
plex.RefreshGuide(dvrs).then(() => { }, (err) => { console.error(err, i) })
if (plexServers[i].arChannels && channels.length !== 0)
plex.RefreshChannels(channels, dvrs).then(() => { }, (err) => { console.error(err, i) })
})
}).catch( (err) => {
console.error("There was an error when fetching Plex DVRs. This means pseudoTV couldn't trigger Plex to update its TV guide." + err);
});
}
}, (err) => {
console.error("Failed to write the xmltv.xml file. Something went wrong. Check your output directory via the web UI and verify file permissions?", err)

View File

@ -135,13 +135,5 @@ function _writeProgramme(xw, program) {
xw.endElement()
}
function _createXMLTVDate(d) {
function pad(n) { return n < 10 ? '0' + n : n }
var timezone = d.toString().split('GMT')
timezone = timezone[timezone.length - 1].split(' ')[0]
return d.getFullYear() + ""
+ pad(d.getMonth() + 1) + ""
+ pad(d.getDate()) + ""
+ pad(d.getHours()) + ""
+ pad(d.getMinutes()) + ""
+ pad(d.getSeconds()) + " " + timezone
return d.toISOString().substring(0,19).replace(/[-T:]/g,"") + " +0000";
}