From 3ae972841a82aff40090b15663366b7a5d79eaec Mon Sep 17 00:00:00 2001 From: vexorian Date: Thu, 29 Oct 2020 23:47:29 -0400 Subject: [PATCH 1/2] nvidia unraid template should use latest-nvidia --- dizquetv-nvidia.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dizquetv-nvidia.xml b/dizquetv-nvidia.xml index f55aeac..119d37c 100644 --- a/dizquetv-nvidia.xml +++ b/dizquetv-nvidia.xml @@ -1,7 +1,7 @@ dizquetv - vexorian/dizquetv:latest + vexorian/dizquetv:latest-nvidia https://hub.docker.com/r/vexorian/dizquetv host From 82a6ad8acfe60f3355d33cfce6e8dc76559a60a7 Mon Sep 17 00:00:00 2001 From: vexorian Date: Fri, 30 Oct 2020 01:07:59 -0400 Subject: [PATCH 2/2] Hopefully improvements to the TV Guide service. Let's detect the random bug that was reported and at least repair the TV guide in that case, instead of crashing everything. --- src/tv-guide-service.js | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/tv-guide-service.js b/src/tv-guide-service.js index 8d69b41..a252899 100644 --- a/src/tv-guide-service.js +++ b/src/tv-guide-service.js @@ -113,6 +113,7 @@ class TVGuideService let playing = {}; if ( (typeof(previousKnown) !== 'undefined') + && (previousKnown.index !== -1) && (previousKnown.program.duration == channel.programs[previousKnown.index].duration ) && (previousKnown.start + previousKnown.program.duration == t) ) { @@ -126,6 +127,17 @@ class TVGuideService } else { playing = await this.getCurrentPlayingIndex(channel, t); } + if ( (playing.program == null) || (typeof(playing) === 'undefined') ) { + console.log("There is a weird issue with the TV guide generation. A placeholder program is placed to prevent further issues. Please report this."); + playing = { + index: -1, + program: { + isOffline: true, + duration: 30*60*1000, + }, + start: t + } + } if ( playing.program.isOffline && playing.program.type === 'redirect') { let ch2 = playing.program.channel; @@ -189,13 +201,15 @@ class TVGuideService ) { y.program.duration -= melded; programs[ programs.length - 1] = y; - programs.push( { - start: y.start + y.program.duration, - program: { - isOffline : true, - duration: melded, - }, - } ); + if (y.start + y.program.duration < t1) { + programs.push( { + start: y.start + y.program.duration, + program: { + isOffline : true, + duration: melded, + }, + } ); + } melded = 0; } else { programs[ programs.length - 1] = y; @@ -216,7 +230,14 @@ class TVGuideService }; while (x.start < t1) { await push(x); - x = await this.getChannelPlaying(channel, x, x.start + x.program.duration); + let t2 = x.start + x.program.duration; + x = await this.getChannelPlaying(channel, x, t2); + if (x.start < t2) { + let d = t2 - x.start; + x.start = t2; + x.program = clone(x.program); + x.program.duration -= d; + } if (x.program.duration == 0) throw Error("D"); } result.programs = [];