feat(codechef): implement full CodeChef support (#354)
## Problem CodeChef had no working login, submit, or contest list. The browser selectors were wrong, the contest list was missing present/past contests, and problem/contest URLs were unset. ## Solution Fix login and submit selectors for the Drupal-based site. Paginate `/api/list/contests/past` to collect all 228 Starters, then expand each parent contest into individual division entries (e.g. `START228 (Div. 4)`). Add language IDs, correct `url`/`contest_url`/`standings_url` in metadata, and make `:CP <platform>` open the contest picker directly.
This commit is contained in:
parent
c7f2af16d4
commit
3c11d609f5
26 changed files with 336 additions and 158 deletions
|
|
@ -134,6 +134,9 @@ local function race_try_setup(platform, contest_id, language, attempt, token)
|
|||
)
|
||||
end
|
||||
|
||||
---@param platform string
|
||||
---@param contest_id string
|
||||
---@param language? string
|
||||
function M.start(platform, contest_id, language)
|
||||
if not platform or not vim.tbl_contains(constants.PLATFORMS, platform) then
|
||||
logger.log('Invalid platform', { level = vim.log.levels.ERROR })
|
||||
|
|
@ -252,6 +255,7 @@ function M.start(platform, contest_id, language)
|
|||
)
|
||||
end
|
||||
|
||||
---@return nil
|
||||
function M.stop()
|
||||
local timer = race_state.timer
|
||||
if not timer then
|
||||
|
|
@ -276,6 +280,7 @@ function M.stop()
|
|||
)
|
||||
end
|
||||
|
||||
---@return { active: boolean, platform?: string, contest_id?: string, remaining_seconds?: integer }
|
||||
function M.status()
|
||||
if not race_state.timer or not race_state.start_time then
|
||||
return { active = false }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue