From ef02cc22ae723ebe3435b65aebbede8c5c97c61d Mon Sep 17 00:00:00 2001 From: Tom Hirschberger Date: Thu, 11 Feb 2021 12:51:29 +0100 Subject: [PATCH 1/2] fixed a bug which caused the stations not to be displayed correctly if scroll is disabled and there are less stations avialable than needed (2*beforeAndAfter + 1) --- MMM-MplayerRadio.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MMM-MplayerRadio.js b/MMM-MplayerRadio.js index 046c1ab..6eed779 100644 --- a/MMM-MplayerRadio.js +++ b/MMM-MplayerRadio.js @@ -245,8 +245,9 @@ Module.register('MMM-MplayerRadio', { if(self.config.showStations){ let stationsWrapper = document.createElement("div") stationsWrapper.className = "stationsWrapper" - if(self.config.showStations || (self.getNumberOfStationsInCurrentProfile() < ((self.config.stationsBeforeAndAfter * 2)+1))){ - if (self.config.scrollableStations){ + if(self.config.showStations){ + console.log("RADIO: Number of stations in this profile: "+self.getNumberOfStationsInCurrentProfile()) + if (self.config.scrollableStations || (self.getNumberOfStationsInCurrentProfile() < ((self.config.stationsBeforeAndAfter * 2)+1))){ for (let curId = 0; curId < self.config.stations.length; curId ++){ if( (typeof self.config.stations[curId].profiles === 'undefined') || @@ -293,6 +294,7 @@ Module.register('MMM-MplayerRadio', { }, getNumberOfStationsInCurrentProfile: function(){ + const self = this if (self.currentProfile === ''){ return self.config.stations.length } else { From 21bec42d1658234f2a1a4d88acb2abd25a3ff443 Mon Sep 17 00:00:00 2001 From: Tom Hirschberger Date: Thu, 11 Feb 2021 12:52:43 +0100 Subject: [PATCH 2/2] new version is 0.0.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ee5a5a5..38d39d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "MMM-MplayerRadio", - "version": "0.0.5", + "version": "0.0.6", "description": "", "main": "MMM-MplayerRadio.js", "dependencies": {