diff --git a/lua/cp/cache.lua b/lua/cp/cache.lua index 3370532..ee6c3dd 100644 --- a/lua/cp/cache.lua +++ b/lua/cp/cache.lua @@ -396,9 +396,9 @@ function M.set_contest_summaries(platform, contests) cache_data[platform] = cache_data[platform] or {} for _, contest in ipairs(contests) do cache_data[platform][contest.id] = cache_data[platform][contest.id] or {} - cache_data[platform][contest.id].display_name = contest.display_name + cache_data[platform][contest.id].display_name = (contest.display_name ~= vim.NIL and contest.display_name) or contest.name cache_data[platform][contest.id].name = contest.name - if contest.start_time then + if contest.start_time and contest.start_time ~= vim.NIL then cache_data[platform][contest.id].start_time = contest.start_time end end diff --git a/scrapers/kattis.py b/scrapers/kattis.py index 43ce1f3..b8ad0bf 100644 --- a/scrapers/kattis.py +++ b/scrapers/kattis.py @@ -123,7 +123,7 @@ def _parse_contests_page(html: str) -> list[ContestSummary]: start_time = int(dt.timestamp()) except Exception: pass - results.append(ContestSummary(id=cid, name=name, start_time=start_time)) + results.append(ContestSummary(id=cid, name=name, display_name=name, start_time=start_time)) return results