Hotfix for 0.0.66 issues: xmltv path not being configurable and xmltv cache option being ignored.
This commit is contained in:
parent
d4607a86a6
commit
e2b94c62cb
5
index.js
5
index.js
@ -59,7 +59,7 @@ db.connect(process.env.DATABASE, ['channels', 'plex-servers', 'ffmpeg-settings',
|
||||
|
||||
initDB(db, channelDB)
|
||||
|
||||
const guideService = new TVGuideService(xmltv);
|
||||
const guideService = new TVGuideService(xmltv, db);
|
||||
|
||||
|
||||
|
||||
@ -73,7 +73,8 @@ let xmltvInterval = {
|
||||
channels = await Promise.all( channelNumbers.map( async (x) => {
|
||||
return await channelCache.getChannelConfig(channelDB, x);
|
||||
}) );
|
||||
await guideService.refresh( await channelDB.getAllChannels(), 12*60*60*1000 );
|
||||
let xmltvSettings = db['xmltv-settings'].find()[0];
|
||||
await guideService.refresh( await channelDB.getAllChannels(), xmltvSettings.cache*60*60*1000 );
|
||||
xmltvInterval.lastRefresh = new Date()
|
||||
console.log('XMLTV Updated at ', xmltvInterval.lastRefresh.toLocaleString());
|
||||
} catch (err) {
|
||||
|
||||
@ -7,7 +7,7 @@ class TVGuideService
|
||||
/****
|
||||
*
|
||||
**/
|
||||
constructor(xmltv) {
|
||||
constructor(xmltv, db) {
|
||||
this.cached = null;
|
||||
this.lastUpdate = 0;
|
||||
this.updateTime = 0;
|
||||
@ -17,6 +17,7 @@ class TVGuideService
|
||||
this.throttleX = 0;
|
||||
this.doThrottle = false;
|
||||
this.xmltv = xmltv;
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
async get() {
|
||||
@ -327,9 +328,7 @@ class TVGuideService
|
||||
}
|
||||
|
||||
async refreshXML() {
|
||||
let xmltvSettings = {
|
||||
file : "./.dizquetv/xmltv.xml",
|
||||
}
|
||||
let xmltvSettings = this.db['xmltv-settings'].find()[0];
|
||||
await this.xmltv.WriteXMLTV(this.cached, xmltvSettings, async() => await this._throttle() );
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user