diff --git a/CHANGELOG.md b/CHANGELOG.md index 49128c11..d88042e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added Hebrew translation. - Add HTTPS support and update config.js.sample - Run tests on long term support and latest stable version of nodejs +- Added the ability to configure a list of modules that shouldn't be update checked. ### Fixed - Force declaration of public ip adress in config file (ISSUE #1852) diff --git a/modules/default/updatenotification/node_helper.js b/modules/default/updatenotification/node_helper.js index 03ecd745..818697c0 100644 --- a/modules/default/updatenotification/node_helper.js +++ b/modules/default/updatenotification/node_helper.js @@ -22,7 +22,7 @@ module.exports = NodeHelper.create({ simpleGits.push({"module": "default", "git": SimpleGit(path.normalize(__dirname + "/../../../"))}); for (moduleName in modules) { - if (defaultModules.indexOf(moduleName) < 0) { + if (!this.ignoreUpdateChecking(moduleName)) { // Default modules are included in the main MagicMirror repo var moduleFolder = path.normalize(__dirname + "/../../" + moduleName); @@ -56,15 +56,15 @@ module.exports = NodeHelper.create({ this.config = payload; } else if(notification === "MODULES") { // if this is the 1st time thru the update check process - if(this.updateProcessStarted==false ){ - this.updateProcessStarted=true; + if (!this.updateProcessStarted) { + this.updateProcessStarted = true; this.configureModules(payload); - this.preformFetch(); + this.performFetch(); } } }, - preformFetch() { + performFetch() { var self = this; simpleGits.forEach(function(sg) { sg.git.fetch().status(function(err, data) { @@ -91,8 +91,23 @@ module.exports = NodeHelper.create({ var self = this; clearTimeout(this.updateTimer); this.updateTimer = setTimeout(function() { - self.preformFetch(); + self.performFetch(); }, delay); + }, + + ignoreUpdateChecking: function(moduleName) { + // Should not check for updates for default modules + if (defaultModules.indexOf(moduleName) >= 0) { + return true; + } + + // Should not check for updates for ignored modules + if (this.config.ignoreModules.indexOf(moduleName) >= 0) { + return true; + } + + // The rest of the modules that passes should check for updates + return false; } }); diff --git a/modules/default/updatenotification/updatenotification.js b/modules/default/updatenotification/updatenotification.js index d4bdc568..35a018bf 100644 --- a/modules/default/updatenotification/updatenotification.js +++ b/modules/default/updatenotification/updatenotification.js @@ -3,6 +3,7 @@ Module.register("updatenotification", { defaults: { updateInterval: 10 * 60 * 1000, // every 10 minutes refreshInterval: 24 * 60 * 60 * 1000, // one day + ignoreModules: [] }, suspended: false,