Skip to content

Commit

Permalink
Added 'url' as a logo format for leagues to use logos as provided by …
Browse files Browse the repository at this point in the history
…the feeds.
  • Loading branch information
jclarke0000 committed Mar 26, 2018
1 parent 87d8c9a commit 65174d7
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
16 changes: 10 additions & 6 deletions MMM-MyScoreboard.css
Expand Up @@ -539,8 +539,8 @@
.MMM-MyScoreboard .box-score.oneLineWithLogos.home-team-first .score.visitor {
left: 182px;
}
.MMM-MyScoreboard .box-score.oneLine .score.home,
.MMM-MyScoreboard .box-score.oneLineWithLogos .score.home {
.MMM-MyScoreboard .box-score.oneLine.home-team-first .score.home,
.MMM-MyScoreboard .box-score.oneLineWithLogos.home-team-first .score.home {
left: 62px;
}

Expand Down Expand Up @@ -671,7 +671,9 @@
}

.MMM-MyScoreboard .box-score.stacked .score,
.MMM-MyScoreboard .box-score.stackedWithLogos .score {
.MMM-MyScoreboard .box-score.stackedWithLogos .score,
.MMM-MyScoreboard .box-score.stacked.home-team-first .score,
.MMM-MyScoreboard .box-score.stackedWithLogos.home-team-first .score {
left: 140px;
width: 44px;
color: #AAA;
Expand All @@ -690,9 +692,10 @@
.MMM-MyScoreboard .box-score.stacked.home-team-first .score.visitor,
.MMM-MyScoreboard .box-score.stackedWithLogos.home-team-first .score.visitor {
top:30px;
right: auto;
}
.MMM-MyScoreboard .box-score.stacked .score.home,
.MMM-MyScoreboard .box-score.stackedWithLogos .score.home {
.MMM-MyScoreboard .box-score.stacked.home-team-first .score.home,
.MMM-MyScoreboard .box-score.stackedWithLogos.home-team-first .score.home {
top: 6px;
}

Expand Down Expand Up @@ -748,7 +751,8 @@
top: 8px;
}

.MMM-MyScoreboard .box-score.stackedWithLogos .score {
.MMM-MyScoreboard .box-score.stackedWithLogos .score,
.MMM-MyScoreboard .box-score.stackedWithLogos.home-team-first .score {
left: 146px;
}
.MMM-MyScoreboard .box-score.stackedWithLogos .score.visitor {
Expand Down
4 changes: 4 additions & 0 deletions MMM-MyScoreboard.js
Expand Up @@ -522,6 +522,10 @@ Module.register("MMM-MyScoreboard",{
gameDate.subtract(1, "day");
}

//just used for debug, if you want to force a specific date
if (this.config.gameDate) {
gameDate = moment(this.config.gameDate, "YYYYMMDD");
}

var self = this;
this.config.sports.forEach( function(sport, index) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -84,7 +84,7 @@ Currently this module supports the following leagues:
* **CFL** - Canadian Football League
* **NCAAF** - NCAA College Football (FBS Division only)
* **NCAAM** - NCAA College Basketball (Division I)
* **NCAAM_MM** - NCAA College Basketball (March Madness Tournament
* **NCAAM_MM** - NCAA College Basketball (March Madness Tournament)
* **EPL** - English Premier League Soccer
* **BRAS** - Brazilian League 1 Soccer

Expand Down
16 changes: 14 additions & 2 deletions providers/ESPN.js
Expand Up @@ -254,7 +254,7 @@ module.exports = {
break;
case "28": //SOCCER
gameState = 2;
status.push("Final" + self.getFinalOT(league, game.status.period));
status.push("Full Time" + self.getFinalOT(league, game.status.period));
break;
default: //Anything else, treat like a game that hasn't started yet
gameState = 0;
Expand Down Expand Up @@ -375,6 +375,13 @@ module.exports = {
return (p - 4) + "OT";
}
break;
case "EPL":
case "BRAS":
if (p == 3) {
return "OT";
} else if (p > 3) {
return (p - 2) + "OT";
}
}
return this.getOrdinal(p);
},
Expand All @@ -391,9 +398,14 @@ module.exports = {
return " (" + (p - 4) + "OT)";
}
break;
case "EPL":
case "BRAS":
if (p > 2) {
return " (OT)";
}
}
return "";
}
},



Expand Down
12 changes: 10 additions & 2 deletions providers/SNET.js
Expand Up @@ -19,7 +19,7 @@
All sports are provided in a single feed at
http://www.sportsnet.ca/wp-content/uploads/scoreboard.json
http://www.sportsnet.ca/wp-content/files/scoreboard.json
The feed takes no parameters. It returns all of today's games,
yesterday's finals up until noon Eastern time, and upcoming
Expand Down Expand Up @@ -330,6 +330,12 @@ module.exports = {
break;
}

/*
URLs to logo images are available in the feed, but they are a bit too low
quaity for some of the templates. However, logos are available at higher
resolution if we replace "59x59" with "200x200" in the path.
*/

var formattedGame = {
classes: classes,
gameMode: gameState,
Expand All @@ -339,7 +345,9 @@ module.exports = {
vTeamLong: game.visiting_team_short == "TBD" ? "TBD" : self.titleCase(game.visiting_team),
hScore: game.home_score,
vScore: game.visiting_score,
status: status
status: status,
hTeamLogoUrl: game.home_team_logo_url ? game.home_team_logo_url.replace("59x59","200x200") : "",
vTeamLogoUrl: game.visiting_team_logo_url ? game.visiting_team_logo_url.replace("59x59","200x200") : ""
};

formattedGames.push(formattedGame);
Expand Down

0 comments on commit 65174d7

Please sign in to comment.