Merge branch 'dev/0.0.x' into main

This commit is contained in:
vexorian 2020-09-05 21:09:30 -04:00
commit 7bad6ffcae
4 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# dizqueTV 0.0.66
# dizqueTV 0.0.67-prerelease
![Discord](https://img.shields.io/discord/711313431457693727?logo=discord&logoColor=fff&style=flat-square) ![GitHub top language](https://img.shields.io/github/languages/top/vexorian/dizquetv?logo=github&style=flat-square) ![Docker Pulls](https://img.shields.io/docker/pulls/vexorian/dizquetv?logo=docker&logoColor=fff&style=flat-square)
Create live TV channel streams from media on your Plex servers.

View File

@ -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) {

View File

@ -4,5 +4,5 @@ module.exports = {
STEALTH_DURATION: 5 * 60* 1000,
TVGUIDE_MAXIMUM_FLEX_DURATION : 6 * 60 * 60 * 1000,
VERSION_NAME: "0.0.66"
VERSION_NAME: "0.0.67-prerelease"
}

View File

@ -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() );
}