From 86f71bf1782aaeb2978949f54fe6b8e760c30d53 Mon Sep 17 00:00:00 2001 From: jzitnik-dev Date: Wed, 25 Mar 2026 08:51:38 +0100 Subject: [PATCH] fix: Some minor fixes --- scrape/parse/v3.ts | 14 +++++++++----- web/content/posts/api/lib/index.md | 2 ++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scrape/parse/v3.ts b/scrape/parse/v3.ts index 09b41a0..479bba5 100644 --- a/scrape/parse/v3.ts +++ b/scrape/parse/v3.ts @@ -318,7 +318,7 @@ function extractTakesPlace(sheet: Worksheet) { const cellTry = sheet.getCell(`${cellTest}${i}`) const cellValue = (typeof cellTry?.value === 'string' ? cellTry.value.trim() : "") || ""; - if (cellValue.length >= threshold) { + if (cellValue.length >= threshold || cellTry.isMerged) { str += `\n${cellValue}`; con = true; break; @@ -353,12 +353,16 @@ function extractReservedRooms(sheet: Worksheet) { cells.forEach((address) => { const row = sheet.getRow(Number(sheet.getCell(address).row)); - row.eachCell((cell) => { - if (cell.address === address) return; + function numToChar(n: number) { + return String.fromCharCode(n + 66); + } + + for (let i = 0; i < 10; i++) { + const cell = row.getCell(numToChar(i)); const val = cell.value?.toString().trim(); result.push(!val || val.length == 0 ? null : val) - }); + } }); while (result.length < 10) { @@ -424,4 +428,4 @@ function formatNowTime() { ); } -//parseV3("db/current.xlsx") +//parseV3("volume/db/current.xlsx") diff --git a/web/content/posts/api/lib/index.md b/web/content/posts/api/lib/index.md index 08c4c06..8c0ecf2 100644 --- a/web/content/posts/api/lib/index.md +++ b/web/content/posts/api/lib/index.md @@ -8,6 +8,8 @@ TocOpen: true Ječná Rozvrh API má svoji Rust knihovnu pro komunikaci s API. Obsahuje mappings pro Kotlin. Pro další jazyky budou mappingy v budoucnu. +[Zdrojový kód knihovny](https://gitea.local.jzitnik.dev/jzitnik/jecna-supl-client) + ## Usage ### `JecnaSuplClient` struct