fix(scraper): comments

This commit is contained in:
Barrett Ruth 2025-09-21 00:10:10 -04:00
parent a8984d013a
commit 9deedec15a
3 changed files with 2 additions and 4 deletions

View file

@ -80,6 +80,8 @@ local function setup_problem(contest_id, problem_id, language)
end
end
-- NOTE: CSES uses different cache key structure: (platform, category, problem_id)
-- vs other platforms: (platform, contest_id, problem_letter)
local cache_contest_id = state.platform == 'cses' and state.contest_id or contest_id
local cache_problem_id = state.platform == 'cses' and contest_id or problem_id
local cached_test_cases = cache.get_test_cases(state.platform, cache_contest_id, cache_problem_id)

View file

@ -366,7 +366,6 @@ def scrape_contests() -> list[ContestSummary]:
page_contests = future.result()
page_results[page] = page_contests
# Sort by page number to maintain order
all_contests = []
for page in sorted(page_results.keys()):
all_contests.extend(page_results[page])

View file

@ -249,14 +249,12 @@ def scrape_contests() -> list[ContestSummary]:
if match:
display_name = f"Global Round {match.group(1)}"
elif "Codeforces Round" in name:
# Handle various Div patterns
div_match = re.search(r"Codeforces Round (\d+) \(Div\. (\d+)\)", name)
if div_match:
display_name = (
f"Round {div_match.group(1)} (Div. {div_match.group(2)})"
)
else:
# Handle combined divs like "Div. 1 + Div. 2"
combined_match = re.search(
r"Codeforces Round (\d+) \(Div\. 1 \+ Div\. 2\)", name
)
@ -265,7 +263,6 @@ def scrape_contests() -> list[ContestSummary]:
f"Round {combined_match.group(1)} (Div. 1 + Div. 2)"
)
else:
# Handle single div like "Div. 1"
single_div_match = re.search(
r"Codeforces Round (\d+) \(Div\. 1\)", name
)