docs: update AGENTS.md with project rules

This commit is contained in:
2026-06-01 20:12:08 +02:00
parent 9f320e2f91
commit 03eeec6615
2 changed files with 25 additions and 12 deletions

View File

@@ -6,14 +6,22 @@
/* global parsePGN, filterLaraGames, getLiveGame, getTodaysGames, getLatestGame */
async function fetchRoundPGN(round) {
const res = await fetch(`https://www.deutsche-schachjugend.de/2026/odjm-d/partien/${round}.pgn?t=${Date.now()}`);
if (!res.ok) return null;
const buf = await res.arrayBuffer();
let text = new TextDecoder('utf-8').decode(buf);
if (text.includes('\uFFFD')) {
text = new TextDecoder('iso-8859-1').decode(buf);
try {
const res = await fetch(`https://www.deutsche-schachjugend.de/2026/odjm-d/partien/${round}.pgn?t=${Date.now()}`);
if (!res.ok) {
console.error(`Fehler beim Abrufen der Runde ${round}: HTTP ${res.status}`);
return null;
}
const buf = await res.arrayBuffer();
let text = new TextDecoder('utf-8').decode(buf);
if (text.includes('\uFFFD')) {
text = new TextDecoder('iso-8859-1').decode(buf);
}
return text;
} catch (error) {
console.error(`Fehler beim Abrufen der Runde ${round}:`, error);
return null;
}
return text;
}
async function loadPGN(showOverlay = true) {
@@ -41,6 +49,7 @@ async function loadPGN(showOverlay = true) {
allLaraGames = filterLaraGames(allGames);
if (allLaraGames.length === 0) {
console.warn('Keine Spiele gefunden für die aktuellen Runden');
return;
}
@@ -67,7 +76,8 @@ async function loadPGN(showOverlay = true) {
} catch (error) {
if (currentPollId !== pollId) return;
console.error('Fehler beim Laden:', error);
console.error('Fehler beim Laden der PGN-Daten:', error);
showError('Fehler beim Aktualisieren der Daten. Bitte versuche es später erneut.');
showLoading(false);
}
}
@@ -75,7 +85,10 @@ async function loadPGN(showOverlay = true) {
async function updateStandings() {
try {
const res = await fetch(`https://www.deutsche-schachjugend.de/2026/odjm-d/tabelle/?t=${Date.now()}`);
if (!res.ok) throw new Error('Fehler beim Laden');
if (!res.ok) {
console.error('Fehler beim Abrufen der Tabellenstände:', res.status);
throw new Error(`HTTP Fehler: ${res.status}`);
}
const html = await res.text();
const roundMatch = html.match(/Tabellenstand\s+nach\s+der\s+(\d+)\.\s*Runde/);
@@ -130,7 +143,8 @@ async function updateStandings() {
}
}
document.getElementById('standings-content').innerHTML = '<div class="standings-loading">Daten nicht verfügbar</div>';
} catch {
} catch (error) {
console.error('Fehler beim Aktualisieren der Tabellenstände:', error);
document.getElementById('standings-content').innerHTML = '<div class="standings-loading">Daten nicht verfügbar</div>';
}
}