diff --git a/partner/tba.go b/partner/tba.go index b4fc4a5..73ec774 100644 --- a/partner/tba.go +++ b/partner/tba.go @@ -20,7 +20,7 @@ import ( const ( tbaBaseUrl = "https://www.thebluealliance.com" tbaAuthKey = "MAApv9MCuKY9MSFkXLuzTSYBCdosboxDq8Q3ujUE2Mn8PD3Nmv64uczu5Lvy0NQ3" - avatarsDir = "static/img/avatars" + AvatarsDir = "static/img/avatars" ) type TbaClient struct { @@ -242,7 +242,7 @@ func (client *TbaClient) DownloadTeamAvatar(teamNumber, year int) error { } // Store the avatar to disk as a PNG file. - avatarPath := fmt.Sprintf("%s/%d.png", avatarsDir, teamNumber) + avatarPath := fmt.Sprintf("%s/%d.png", AvatarsDir, teamNumber) ioutil.WriteFile(avatarPath, avatarBytes, 0644) return nil } diff --git a/static/js/audience_display.js b/static/js/audience_display.js index fb48b08..f35475e 100644 --- a/static/js/audience_display.js +++ b/static/js/audience_display.js @@ -450,7 +450,7 @@ var initializeSponsorDisplay = function() { }; var getAvatarUrl = function(teamId) { - return "/static/img/avatars/" + teamId + ".png"; + return "/api/teams/" + teamId + "/avatar"; }; $(function() { @@ -476,9 +476,6 @@ $(function() { overlayCenteringShowParams = overlayCenteringBottomShowParams; } - // Fall back to a blank avatar if one doesn't exist for the team. - $(".avatar, .final-avatar").attr("onerror", "this.src='" + getAvatarUrl(0) + "';"); - // Set up the websocket back to the server. websocket = new CheesyWebsocket("/displays/audience/websocket", { allianceSelection: function(event) { handleAllianceSelection(event.data); }, diff --git a/static/js/queueing_display.js b/static/js/queueing_display.js index a085b50..698c537 100644 --- a/static/js/queueing_display.js +++ b/static/js/queueing_display.js @@ -29,9 +29,6 @@ var handleMatchTime = function(data) { }; $(function() { - // Fall back to a blank avatar if one doesn't exist for the team. - $(".avatar").attr("onerror", "this.src='/static/img/avatars/0.png';"); - // Set up the websocket back to the server. websocket = new CheesyWebsocket("/displays/queueing/websocket", { matchLoad: function(event) { handleMatchLoad(event.data); }, diff --git a/templates/queueing_display.html b/templates/queueing_display.html index 6efda1f..6fe2f37 100644 --- a/templates/queueing_display.html +++ b/templates/queueing_display.html @@ -53,9 +53,9 @@ {{end}}