fix: parse latest tournament from recent-events list on player page (#24) #25
Reference in New Issue
Block a user
Delete Branch "fix/parse-recent-events-tournament-24"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
<li class="recent-events">element on the player page so the most recently played tournament (which now lingers outsidetable[id*="player-results"]) is picked up bygetNewTournamentRounds.Setkeyed on normalized absolute URLs (new URL(href, location.origin).href), so an event that later migrates into the table doesn't get double-processed during the overlap window.afterDate— otherwise skip with awarnrather than store rounds with a wrong date (e.g. a registration deadline captured by the regex).Closes #24
Test plan
/player/<N>page currently shows a tournament under<li class="recent-events">that is NOT in anytable[id*="player-results"]UPDATE players SET last_round_update = NULL WHERE pdga_number = <N>;curl -X POST http://localhost:3000/api/refresh-round-history/<N>new tournament URL discovery completedwithrecentEventsMatches >= 1recent-events: scraping tournamentandrecent-events: date recovered from event page(debug level).recent-eventselement — confirmrecentEventsAnchorsSeen: 0and no change in round count