fields fixed

This commit is contained in:
Ravi Prasad
2025-06-03 02:25:32 -05:00
parent 58b27fdb76
commit e9e77e8e22
8 changed files with 213 additions and 53 deletions
+5 -6
View File
@@ -9,9 +9,9 @@ import (
"github.com/nprasad2077/NBA_Go/utils"
)
// importPlayerAdvanced fetches and stores advanced stats for seasons 20232025
// importPlayerAdvanced fetches and stores advanced stats for seasons 20172025
func importPlayerAdvanced(db *gorm.DB) {
for season := 2023; season <= 2025; season++ {
for season := 2017; season <= 2022; season++ {
if err := services.FetchAndStorePlayerAdvancedScrapedStats(db, season, false); err != nil {
log.Printf("advanced import failed for %d: %v", season, err)
}
@@ -22,9 +22,8 @@ func importPlayerAdvanced(db *gorm.DB) {
}
// importPlayerAdvancedPlayoffs fetches and stores advanced stats for playoffs seasons 20232025
func importPlayerAdvancedPlayoffs(db *gorm.DB) {
for season := 2023; season <= 2025; season++ {
for season := 2017; season <= 2022; season++ {
if err := services.FetchAndStorePlayerAdvancedScrapedStats(db, season, true); err != nil {
log.Printf("advanced import failed for %d: %v", season, err)
}
@@ -46,7 +45,7 @@ func importPlayerShotChart(db *gorm.DB) {
// importPlayerTotalsScrape fetches & stores scraped regular-season total stats
func importPlayerTotalsScrape(db *gorm.DB) {
for season := 1993; season <= 2025; season++ {
for season := 2017; season <= 2022; season++ {
if err := services.FetchAndStorePlayerTotalScrapedStats(db, season, false); err != nil {
log.Printf("scraped totals import failed for %d: %v", season, err)
}
@@ -58,7 +57,7 @@ func importPlayerTotalsScrape(db *gorm.DB) {
// importPlayerPlayoffsScrape fetches & stores scraped playoff total stats
func importPlayerTotalsPlayoffsScrape(db *gorm.DB) {
for season := 1993; season <= 2025; season++ {
for season := 2017; season <= 2022; season++ {
if err := services.FetchAndStorePlayerTotalScrapedStats(db, season, true); err != nil {
log.Printf("scraped playoffs import failed for %d: %v", season, err)
}