From d8e6cdfccf7715d717c35668bb84ecf581eb4f0f Mon Sep 17 00:00:00 2001 From: Ravi Prasad Date: Wed, 18 Jun 2025 19:13:27 -0500 Subject: [PATCH] auth remove time --- import.go | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/import.go b/import.go index 7686d26..5650edb 100644 --- a/import.go +++ b/import.go @@ -11,7 +11,7 @@ import ( // importPlayerAdvanced fetches and stores advanced stats for seasons 2017–2025 func importPlayerAdvanced(db *gorm.DB) { - for season := 2017; season <= 2022; season++ { + for season := 2023; season <= 2025; season++ { if err := services.FetchAndStorePlayerAdvancedScrapedStats(db, season, false); err != nil { log.Printf("advanced import failed for %d: %v", season, err) } @@ -23,7 +23,7 @@ func importPlayerAdvanced(db *gorm.DB) { // importPlayerAdvancedPlayoffs fetches and stores advanced stats for playoffs seasons 2023–2025 func importPlayerAdvancedPlayoffs(db *gorm.DB) { - for season := 2017; season <= 2022; season++ { + for season := 2023; season <= 2025; season++ { if err := services.FetchAndStorePlayerAdvancedScrapedStats(db, season, true); err != nil { log.Printf("advanced import failed for %d: %v", season, err) } @@ -33,19 +33,9 @@ func importPlayerAdvancedPlayoffs(db *gorm.DB) { } } -// importPlayerShotChart fetches shot-charts for every known player -// func importPlayerShotChart(db *gorm.DB) { -// const firstID = "hardeja01" -// log.Printf("▶️ importing shot chart for player %s…", firstID) -// if err := services.FetchAndStoreShotChartForPlayer(db, firstID); err != nil { -// log.Printf("shot chart import failed for %s: %v", firstID, err) -// } -// // you can add more IDs here or just rely on the API endpoint after -// } - // importPlayerTotalsScrape fetches & stores scraped regular-season total stats func importPlayerTotalsScrape(db *gorm.DB) { - for season := 2017; season <= 2022; season++ { + for season := 2023; season <= 2025; season++ { if err := services.FetchAndStorePlayerTotalScrapedStats(db, season, false); err != nil { log.Printf("scraped totals import failed for %d: %v", season, err) } @@ -57,7 +47,7 @@ func importPlayerTotalsScrape(db *gorm.DB) { // importPlayerPlayoffsScrape fetches & stores scraped playoff total stats func importPlayerTotalsPlayoffsScrape(db *gorm.DB) { - for season := 2017; season <= 2022; season++ { + for season := 2023; season <= 2025; season++ { if err := services.FetchAndStorePlayerTotalScrapedStats(db, season, true); err != nil { log.Printf("scraped playoffs import failed for %d: %v", season, err) } @@ -65,4 +55,17 @@ func importPlayerTotalsPlayoffsScrape(db *gorm.DB) { time.Sleep(1100 * time.Millisecond) utils.SleepWithJitter(1750 * time.Millisecond) } -} \ No newline at end of file +} + + + + +// importPlayerShotChart fetches shot-charts for every known player +// func importPlayerShotChart(db *gorm.DB) { +// const firstID = "hardeja01" +// log.Printf("▶️ importing shot chart for player %s…", firstID) +// if err := services.FetchAndStoreShotChartForPlayer(db, firstID); err != nil { +// log.Printf("shot chart import failed for %s: %v", firstID, err) +// } +// // you can add more IDs here or just rely on the API endpoint after +// }