- cancel_sub: add parse_mode=MARKDOWN_V2 so users don't see literal backslashes
- /removeplayer: add CommandHandler that was advertised in /start but missing from handlers
- parse_standings: raise SNo limit 300→5000 to support large open tournaments
- call_bbp_with_checklist: close mkstemp fd to fix resource leak
- _warmup_cache_sync: make time.sleep(1.0) conditional on HTTP fetch, skip for cache hits
- _warmup_cache_sync: derive start_tnr from max(max_tnr_seen, max cached tnr) instead of hardcoded 1445000
- main: remove duplicate print('Client bot started') after blocking run_polling()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- tracker.py _parse_art0_page: stop at first 6-10 digit number as FIDE ID;
national IDs (also 6-10 digits) no longer overwrite it. FED/rating now
scanned forward past the national ID column.
- parser.py fetch_tournament: fuzzy start-list name matching no longer
overrides starting_sno from standings column 0. Fuzzy match is kept only
for rating lookup. Exact name match still may override SNo (reliable).
- tracker.py rescan_existing_tournaments: after each art=0 re-fetch, update
player_sno in subscriptions whose FIDE ID appears at a different SNo than
stored (corrects drift caused by the old parsing bug).
Root cause: national ID of Gorshkov (SNo=26 in Odintsovo Blitz) matched
Vrubel's FIDE ID in the cache; subscription was created with wrong player_sno=26.
DB already patched directly: Vrubel→sno=39, Aslanbekov→sno=40.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- check_all_subscriptions: quick pre-check (1 req, art=4 only) before
full fetch; full fetch only when results_count or current_round changed.
Interval 60s → 300s. Saves ~10,000 req/day per active subscription.
- rescan_existing_tournaments: filter to tournaments ended within last 30
days (or no end_date). Drops from ~2000 cached TNRs to ~30-100 active
ones per run, saving ~22,000 req/day.
- warmup: sleep 1s per TNR instead of 20ms per 500 — spreads initial
full-scan over hours rather than minutes.
- parser: extract _normalize_url helper, add fetch_tournament_quick().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Основные изменения:
- swiss.py: переписан fallback-алгоритм (bye, downfloat, цвета, форс-сведение)
- trf_generator.py: генератор TRF-16 для bbpPairings
- bbp_wrapper.py: обёртка subprocess для bbpPairings.exe
- parser.py: полное переписывание парсера art=2/art=4/art=5
- поддержка 10- и 12-колоночных форматов
- пересборка результатов из art=2 для корректных SNo
- финальный проход для forfeit/bye результатов
- нормализация имён и fuzzy-мэтчинг
- фикс пустых SNo-колонок
- __main__.py: починен JSON-вывод, поддержка bye
- display.py: отображение bye и источника расчёта
Ключевой фикс точности: убран XXC rank из TRF — bbpPairings
теперь использует порядок из турнирной таблицы вместо поля Rank.
Проверено на 5 турнирах (4 из 5 — 100%, 1 — 85% из-за ручных bye).
Принимает URL турнира, показывает пары следующего тура в Telegram-формате.
- parser.py: парсинг chess-results.com
- swiss.py: FIDE Dutch System
- display.py: форматирование для Telegram
- Docker: docker compose run --rm chess-calc 'URL'