mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
auth remove time
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
// importPlayerAdvanced fetches and stores advanced stats for seasons 2017–2025
|
// importPlayerAdvanced fetches and stores advanced stats for seasons 2017–2025
|
||||||
func importPlayerAdvanced(db *gorm.DB) {
|
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 {
|
if err := services.FetchAndStorePlayerAdvancedScrapedStats(db, season, false); err != nil {
|
||||||
log.Printf("advanced import failed for %d: %v", season, err)
|
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
|
// importPlayerAdvancedPlayoffs fetches and stores advanced stats for playoffs seasons 2023–2025
|
||||||
func importPlayerAdvancedPlayoffs(db *gorm.DB) {
|
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 {
|
if err := services.FetchAndStorePlayerAdvancedScrapedStats(db, season, true); err != nil {
|
||||||
log.Printf("advanced import failed for %d: %v", season, err)
|
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
|
// importPlayerTotalsScrape fetches & stores scraped regular-season total stats
|
||||||
func importPlayerTotalsScrape(db *gorm.DB) {
|
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 {
|
if err := services.FetchAndStorePlayerTotalScrapedStats(db, season, false); err != nil {
|
||||||
log.Printf("scraped totals import failed for %d: %v", season, err)
|
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
|
// importPlayerPlayoffsScrape fetches & stores scraped playoff total stats
|
||||||
func importPlayerTotalsPlayoffsScrape(db *gorm.DB) {
|
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 {
|
if err := services.FetchAndStorePlayerTotalScrapedStats(db, season, true); err != nil {
|
||||||
log.Printf("scraped playoffs import failed for %d: %v", season, err)
|
log.Printf("scraped playoffs import failed for %d: %v", season, err)
|
||||||
}
|
}
|
||||||
@@ -66,3 +56,16 @@ func importPlayerTotalsPlayoffsScrape(db *gorm.DB) {
|
|||||||
utils.SleepWithJitter(1750 * time.Millisecond)
|
utils.SleepWithJitter(1750 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 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
|
||||||
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user