mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
clean up
This commit is contained in:
@@ -172,62 +172,4 @@ func FetchAndStorePlayerAdvancedScrapedStats(db *gorm.DB, season int, isPlayoff
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// // 3. map into your model
|
||||
// stat := models.PlayerAdvancedStat{
|
||||
// ExternalID: mustAtoi(data["rk"]),
|
||||
// PlayerID: playerID,
|
||||
// PlayerName: data["player"],
|
||||
// Position: data["pos"],
|
||||
// Age: mustAtoi(data["age"]),
|
||||
// Games: mustAtoi(data["g"]),
|
||||
// MinutesPlayed: mustAtoi(data["mp"]),
|
||||
// PER: mustParseFloat(data["per"]),
|
||||
// TSPercent: mustParseFloat(data["ts_pct"]),
|
||||
// ThreePAR: mustParseFloat(data["three_par"]),
|
||||
// FTR: mustParseFloat(data["ftr"]),
|
||||
// OffensiveRBPercent: mustParseFloat(data["orb_pct"]),
|
||||
// DefensiveRBPercent: mustParseFloat(data["drb_pct"]),
|
||||
// TotalRBPercent: mustParseFloat(data["trb_pct"]),
|
||||
// AssistPercent: mustParseFloat(data["ast_pct"]),
|
||||
// StealPercent: mustParseFloat(data["stl_pct"]),
|
||||
// BlockPercent: mustParseFloat(data["blk_pct"]),
|
||||
// TurnoverPercent: mustParseFloat(data["tov_pct"]),
|
||||
// UsagePercent: mustParseFloat(data["usg_pct"]),
|
||||
// OffensiveWS: mustParseFloat(data["ows"]),
|
||||
// DefensiveWS: mustParseFloat(data["dws"]),
|
||||
// WinShares: mustParseFloat(data["ws"]),
|
||||
// WinSharesPer: mustParseFloat(data["ws_per_48"]),
|
||||
// OffensiveBox: mustParseFloat(data["obpm"]),
|
||||
// DefensiveBox: mustParseFloat(data["dbpm"]),
|
||||
// Box: mustParseFloat(data["bpm"]),
|
||||
// VORP: mustParseFloat(data["vorp"]),
|
||||
// Team: data["team_id"],
|
||||
// Season: season,
|
||||
// IsPlayoff: isPlayoff,
|
||||
// }
|
||||
|
||||
// // 4. upsert
|
||||
// if err := db.Clauses(clause.OnConflict{
|
||||
// Columns: []clause.Column{
|
||||
// {Name: "player_id"},
|
||||
// {Name: "season"},
|
||||
// {Name: "team"},
|
||||
// {Name: "is_playoff"},
|
||||
// },
|
||||
// DoUpdates: clause.AssignmentColumns([]string{
|
||||
// "external_id", "player_name", "position", "age", "games", "minutes_played",
|
||||
// "per", "ts_percent", "three_par", "ftr",
|
||||
// "offensive_rb_percent", "defensive_rb_percent", "total_rb_percent",
|
||||
// "assist_percent", "steal_percent", "block_percent", "turnover_percent",
|
||||
// "usage_percent", "offensive_ws", "defensive_ws", "win_shares",
|
||||
// "win_shares_per", "offensive_box", "defensive_box", "box", "vorp",
|
||||
// }),
|
||||
// }).Create(&stat).Error; err != nil {
|
||||
// log.Printf("Failed upsert advanced for %s: %v", stat.PlayerID, err)
|
||||
// }
|
||||
// })
|
||||
|
||||
// return nil
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user