diff --git a/src/api.js b/src/api.js index 1e417b8..ea2d723 100644 --- a/src/api.js +++ b/src/api.js @@ -856,7 +856,6 @@ function api(db, channelDB, fillerDB, xmltvInterval, guideService, _m3uService, res.set('Cache-Control', 'no-store') res.type('application/xml'); - res.attachment('xmltv.xml'); let xmltvSettings = db['xmltv-settings'].find()[0]; diff --git a/src/plexTranscoder.js b/src/plexTranscoder.js index 21dd1ed..22b0017 100644 --- a/src/plexTranscoder.js +++ b/src/plexTranscoder.js @@ -416,8 +416,15 @@ X-Plex-Token=${this.server.accessToken}`; } updatePlex() { - this.log("Updating plex status") - axios.post(this.getStatusUrl()); + this.log("Updating plex status"); + const statusUrl = this.getStatusUrl(); + try { + axios.post(statusUrl); + } catch (error) { + this.log(`Problem updating Plex status using status URL ${statusUrl}:`); + this.log(error); + return false; + } this.currTimeMs += this.updateInterval; if (this.currTimeMs > this.duration) { this.currTimeMs = this.duration; diff --git a/src/services/time-slots-service.js b/src/services/time-slots-service.js index dfb53a9..849470e 100644 --- a/src/services/time-slots-service.js +++ b/src/services/time-slots-service.js @@ -325,6 +325,9 @@ module.exports = async( programs, schedule ) => { } } + if (ts > t0) { + pushFlex( ts - t0 ); + } while ( (t < hardLimit) && (p.length < LIMIT) ) { await throttle(); //ensure t is padded diff --git a/src/xmltv.js b/src/xmltv.js index a4c7798..5ca97cf 100644 --- a/src/xmltv.js +++ b/src/xmltv.js @@ -105,9 +105,15 @@ async function _writeProgramme(channel, program, xw, xmlSettings, cacheImageServ xw.endElement() xw.startElement('episode-num') - xw.writeAttribute('system', 'xmltv_ns') - xw.text((program.sub.season - 1) + ' . ' + (program.sub.episode - 1) + ' . 0/1') + xw.writeAttribute('system', 'onscreen') + xw.text( "S" + (program.sub.season) + ' E' + (program.sub.episode) ) xw.endElement() + + xw.startElement('episode-num') + xw.writeAttribute('system', 'xmltv_ns') + xw.text((program.sub.season - 1) + '.' + (program.sub.episode - 1) + '.0/1') + xw.endElement() + } // Icon if (typeof program.icon !== 'undefined') { diff --git a/web/controllers/guide.js b/web/controllers/guide.js index 1cbbb75..aa65776 100644 --- a/web/controllers/guide.js +++ b/web/controllers/guide.js @@ -340,6 +340,7 @@ module.exports = function ($scope, $timeout, dizquetv) { } } + $scope.adjustZoom(); $scope.refresh(); $scope.checkUpdates = async () => { diff --git a/web/directives/channel-config.js b/web/directives/channel-config.js index 8f15518..2dc63a4 100644 --- a/web/directives/channel-config.js +++ b/web/directives/channel-config.js @@ -397,9 +397,8 @@ module.exports = function ($timeout, $location, dizquetv, resolutionOptions) { adjustStartTimeToCurrentProgram(); updateChannelDuration(); } - scope.removeDuplicates = () => { + let removeDuplicatesSub = (progs) => { let tmpProgs = {} - let progs = scope.channel.programs for (let i = 0, l = progs.length; i < l; i++) { if ( progs[i].type ==='redirect' ) { tmpProgs['_redirect ' + progs[i].channel + ' _ '+ progs[i].duration ] = progs[i]; @@ -414,7 +413,10 @@ module.exports = function ($timeout, $location, dizquetv, resolutionOptions) { for (let i = 0, l = keys.length; i < l; i++) { newProgs.push(tmpProgs[keys[i]]) } - scope.channel.programs = newProgs + return newProgs; + } + scope.removeDuplicates = () => { + scope.channel.programs = removeDuplicatesSub(scope.channel.programs); updateChannelDuration(); //oops someone forgot to add this } scope.removeOffline = () => { @@ -1880,10 +1882,12 @@ module.exports = function ($timeout, $location, dizquetv, resolutionOptions) { scope.onTimeSlotsButtonClick = () => { - scope.timeSlots.startDialog(scope.channel.programs, scope.maxSize, scope.channel.scheduleBackup ); + let progs = removeDuplicatesSub( scope.channel.programs ); + scope.timeSlots.startDialog( progs, scope.maxSize, scope.channel.scheduleBackup ); } scope.onRandomSlotsButtonClick = () => { - scope.randomSlots.startDialog(scope.channel.programs, scope.maxSize, scope.channel.randomScheduleBackup ); + let progs = removeDuplicatesSub( scope.channel.programs ); + scope.randomSlots.startDialog(progs, scope.maxSize, scope.channel.randomScheduleBackup ); } scope.logoOnChange = (event) => { diff --git a/web/public/index.html b/web/public/index.html index 360b80c..b39f56d 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -12,7 +12,7 @@ -
+

dizqueTV @@ -27,7 +27,7 @@ - + diff --git a/web/public/templates/channel-config.html b/web/public/templates/channel-config.html index d0a655d..dd7f5d0 100644 --- a/web/public/templates/channel-config.html +++ b/web/public/templates/channel-config.html @@ -311,7 +311,7 @@ Add Flex...

-

Programs a Flex time slot. Normally you't use pad times, restrict times or add breaks to add a large quantity of Flex times at once, but this exists for more specific cases.

+

Programs a Flex time slot. Normally you'd use pad times, restrict times or add breaks to add a large quantity of Flex times at once, but this exists for more specific cases.