mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
chore: import window 2015-11-17 [season 2016]
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"current_season": 2016,
|
"current_season": 2016,
|
||||||
"current_from": "2015-11-11",
|
"current_from": "2015-11-17",
|
||||||
"current_to": "2015-11-17",
|
"current_to": "2015-11-23",
|
||||||
"target_end": "2026-06-30",
|
"target_end": "2026-06-30",
|
||||||
"window_days": 6,
|
"window_days": 6,
|
||||||
"completed": false
|
"completed": false
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ func importPlayerTotalsPlayoffsScrape(db *gorm.DB) {
|
|||||||
func importGameSchedules(db *gorm.DB) {
|
func importGameSchedules(db *gorm.DB) {
|
||||||
months := []string{"november"}
|
months := []string{"november"}
|
||||||
|
|
||||||
for season := 2015; season <= 2015; season++ {
|
for season := 2016; season <= 2016; season++ {
|
||||||
log.Printf("--- Starting Game Schedule Import for Season: %d ---", season)
|
log.Printf("--- Starting Game Schedule Import for Season: %d ---", season)
|
||||||
for _, month := range months {
|
for _, month := range months {
|
||||||
if err := services.FetchAndStoreGameSchedule(db, season, month); err != nil {
|
if err := services.FetchAndStoreGameSchedule(db, season, month); err != nil {
|
||||||
@@ -79,8 +79,8 @@ func importGameSchedules(db *gorm.DB) {
|
|||||||
// importBoxScores fetches and stores all box score data (line scores, player/team stats)
|
// importBoxScores fetches and stores all box score data (line scores, player/team stats)
|
||||||
// for games within a recent date range.
|
// for games within a recent date range.
|
||||||
func importBoxScores(db *gorm.DB) {
|
func importBoxScores(db *gorm.DB) {
|
||||||
from := time.Date(2015, time.November, 5, 0, 0, 0, 0, time.UTC)
|
from := time.Date(2015, time.November, 11, 0, 0, 0, 0, time.UTC)
|
||||||
to := time.Date(2015, time.November, 11, 5, 30, 0, 0, time.UTC)
|
to := time.Date(2015, time.November, 17, 5, 30, 0, 0, time.UTC)
|
||||||
|
|
||||||
dateRangeComment := fmt.Sprintf("--- Starting Box Score Data Import for games between %s and %s ---",
|
dateRangeComment := fmt.Sprintf("--- Starting Box Score Data Import for games between %s and %s ---",
|
||||||
from.Format("January 2, 2006"),
|
from.Format("January 2, 2006"),
|
||||||
@@ -146,7 +146,7 @@ func importPlayerShotCharts(db *gorm.DB) {
|
|||||||
|
|
||||||
// importMarkPlayoffGames marks games as playoff using the dedicated Basketball Reference playoff schedule.
|
// importMarkPlayoffGames marks games as playoff using the dedicated Basketball Reference playoff schedule.
|
||||||
func importMarkPlayoffGames(db *gorm.DB) {
|
func importMarkPlayoffGames(db *gorm.DB) {
|
||||||
for season := 2015; season <= 2015; season++ {
|
for season := 2016; season <= 2016; season++ {
|
||||||
if err := services.FetchAndMarkPlayoffGames(db, season+1); err != nil {
|
if err := services.FetchAndMarkPlayoffGames(db, season+1); err != nil {
|
||||||
log.Printf("playoff marking failed for %d: %v", season, err)
|
log.Printf("playoff marking failed for %d: %v", season, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user