From d4607a86a6ce96edc47651936595d8003822e90f Mon Sep 17 00:00:00 2001 From: vexorian Date: Sat, 5 Sep 2020 19:10:50 -0400 Subject: [PATCH 1/2] Prepare 0.0.67 development --- README.md | 2 +- src/constants.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 822bd09..317eb5c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# dizqueTV 0.0.66-prerelease +# 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. diff --git a/src/constants.js b/src/constants.js index fe009fb..e071776 100644 --- a/src/constants.js +++ b/src/constants.js @@ -4,5 +4,5 @@ module.exports = { STEALTH_DURATION: 5 * 60* 1000, TVGUIDE_MAXIMUM_FLEX_DURATION : 6 * 60 * 60 * 1000, - VERSION_NAME: "0.0.66-prerelease" + VERSION_NAME: "0.0.67-prerelease" } From e2b94c62cbc6aae6e114b384a227bc8083c75cf3 Mon Sep 17 00:00:00 2001 From: vexorian Date: Sat, 5 Sep 2020 20:29:43 -0400 Subject: [PATCH 2/2] Hotfix for 0.0.66 issues: xmltv path not being configurable and xmltv cache option being ignored. --- index.js | 5 +++-- src/tv-guide-service.js | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 65542e8..241f5e3 100644 --- a/index.js +++ b/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) { diff --git a/src/tv-guide-service.js b/src/tv-guide-service.js index d7673bc..1d89e36 100644 --- a/src/tv-guide-service.js +++ b/src/tv-guide-service.js @@ -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() ); }