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:
parent
0ffc9737c4
commit
f36b4a13f0
4
index.js
4
index.js
@ -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)
|
||||
|
||||
10
src/xmltv.js
10
src/xmltv.js
@ -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";
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user