diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b89f2aa..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -node_js: - - "stable" - - "7" - - "6" - - "5" -script: - - npm run lint -cache: - directories: - - node_modules diff --git a/CHANGELOG.md b/CHANGELOG.md index bda3b3a..2d8a312 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # MMM-NFL Changelog +## 1.3.1 + +### Fixed + +- [Config option `focus_on` didn't filter match list](https://github.com/fewieden/MMM-NFL/issues/55) + +### Removed + +- TravisCI integration + ## 1.3.0 MagicMirror² version >= 2.15.0 required. diff --git a/MMM-NFL.js b/MMM-NFL.js index 6155134..9504e5f 100644 --- a/MMM-NFL.js +++ b/MMM-NFL.js @@ -72,13 +72,21 @@ Module.register('MMM-NFL', { return this.config.focus_on.filter(team => !this.findTeamInScores(team)); }, + getFilteredScores() { + if (!Array.isArray(this.config.focus_on) || !Array.isArray(this.scores)) { + return this.scores; + } + + return this.scores.filter(m => this.config.focus_on.includes(m.homeTeam) || this.config.focus_on.includes(m.awayTeam)); + }, + getTemplateData() { return { states: this.states, modes: this.mode, details: this.details, config: this.config, - scores: this.scores, + scores: this.getFilteredScores(), focusedTeamsWithByeWeeks: this.getFocusedTeamsWithByeWeeks() }; }, diff --git a/package-lock.json b/package-lock.json index 1a7d0f2..eb711b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mmm-nfl", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4831ea6..5b654f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mmm-nfl", - "version": "1.3.0", + "version": "1.3.1", "description": "National Football League Module for MagicMirror2", "scripts": { "lint": "eslint . && stylelint **/*.css"