Skip to content

Commit

Permalink
bug fixes and additions for GP page
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebRose committed May 3, 2024
1 parent 13b4f4f commit 86579b4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion controller/GameplanController.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ func GetTeamDepthchartByTeamID(w http.ResponseWriter, r *http.Request) {
}

depthchart := managers.GetDepthchartByTeamID(teamID)
gameplan := managers.GetGameplanByGameplanID(teamID)

json.NewEncoder(w).Encode(depthchart)
dcResponse := structs.DepthChartResponse{
CFBDepthChart: depthchart,
CFBGameplan: gameplan,
}

json.NewEncoder(w).Encode(dcResponse)
}

// GetDepthChartByTeamID
Expand Down
2 changes: 1 addition & 1 deletion managers/DiscordManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func GetCFBPlayByPlayStreamData(timeslot, week string, isFBS bool) []structs.Str
HomeTeamDiscordID: homeTeam.DiscordID,
AwayTeamID: uint(game.AwayTeamID),
AwayTeam: game.AwayTeam,
AwayTeamCoach: game.AwayTeam,
AwayTeamCoach: game.AwayTeamCoach,
AwayTeamRank: game.AwayTeamRank,
AwayTeamDiscordID: awayTeam.DiscordID,
AwayLabel: awayTeam.TeamName + " " + awayTeam.Mascot,
Expand Down
7 changes: 6 additions & 1 deletion managers/StatsManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,11 @@ func generateStreamString(play structs.PlayByPlay, playType, playName, poa strin
thirdSegment := ""
list := []string{}

if play.IsSacked || play.IsTouchdown || play.IsINT || play.IsFumble || play.IsSafety ||
(play.ResultYards > 39 && playType != "Kickoff" && playType != "Punt" && playType != "XP" && playType != "FG") {
firstSegment = "REDZONE ALERT: <1235669913478365244>\n"
}

// First Segment
if playType == "Pass" {
qbLabel := getPlayerLabel(participantMap[qbID])
Expand All @@ -1578,7 +1583,7 @@ func generateStreamString(play structs.PlayByPlay, playType, playName, poa strin
turnoverLabel = getPlayerLabel(participantMap[turnID])
}
yards := util.GetYardsString(play.ResultYards)
firstSegment = qbLabel
firstSegment += qbLabel
offForm := util.GetOffensiveFormationByEnum(play.OffFormationID)
passStatement := util.GetPassStatement(int(play.ResultYards), offForm, playName, poa, recLabel, play.IsTouchdown, play.IsOutOfBounds, twoPtCheck, play.IsFumble, play.IsSafety, play.IsScramble, play.IsSacked, play.IsComplete, play.IsINT, turnoverLabel)

Expand Down
7 changes: 7 additions & 0 deletions structs/CollegeTeamDepthchart.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ package structs

import "github.com/jinzhu/gorm"

type DepthChartResponse struct {
CFBDepthChart CollegeTeamDepthChart
CFBGameplan CollegeGameplan
NFLDepthChart NFLDepthChart
NFLGP NFLGameplan
}

type CollegeTeamDepthChart struct {
gorm.Model
TeamID int
Expand Down

0 comments on commit 86579b4

Please sign in to comment.