πŸ”§ Fix Bulk-Upload Game Stats

Finds playerStats and pitchingStats game docs where the CSV bulk-upload used a self-constructed gameDocId (season prefix baked in, hyphens in date) instead of the real Firestore game document ID. Copies each doc to the correct path and deletes the old one.

⚠️ You must be signed in as an admin to run this script.

β€”
Bad docs found
β€”
Matched to game
β€”
Unmatched (no fix)
β€”
Fixed
β€”
Errors

Log

πŸ“… Date Mismatch Scanner

Finds game docs where the date baked into gameDocId doesn't match gameDateFormatted. This catches docs uploaded with the wrong CSV date (e.g. 5/22 instead of 5/21) that passed the normal format check. The doc's gameDateFormatted must already be corrected via the editor before running this.


β€”
Mismatches found
β€”
Matched to game
β€”
Unmatched (no fix)
β€”
Fixed
β€”
Errors

πŸ”€ Opponent Name Split Fix

Scans aggregatedPlayerStats for a bad vsOpponent key (e.g. "Aces Silver") and deletes it from both career.vsOpponent and seasons[*].vsOpponent. Use this after re-aggregating with the corrected opponent name β€” the correct split already has accurate stats, and the bad key is a stale orphan that would cause double-counting.

β€”
Player docs affected
β€”
Split locations
β€”
Fixed
β€”
Errors

πŸ“… Direct Date Fix

Use when stats were submitted with the wrong game date β€” both gameDocId and gameDateFormatted contain the bad date, so the Date Mismatch Scanner can't detect them. This tool scans for docs with the bad date baked into gameDocId, finds the real game on the correct date, and moves them in one step.

β€”
Docs found
β€”
Matched to game
β€”
Unmatched
β€”
Fixed
β€”
Errors

πŸ’£ Out-of-Park Home Run Tracker

Manually flag true out-of-park HRs. These display as a πŸ’£ badge on the current-season HR leaderboard.

πŸ“Š Scan from Stats Reads aggregatedPlayerStats for the season above and compares against flagged records
πŸ’£ Flagged Records
Loading records…