docs: update AGENTS.md with project rules
This commit is contained in:
@@ -4,5 +4,4 @@
|
|||||||
- Commits und Push erfolgen nur durch expliziten Befehl des Nutzers.
|
- Commits und Push erfolgen nur durch expliziten Befehl des Nutzers.
|
||||||
- Der Server (server.py) wird immer unsichtbar gestartet: `Start-Process -NoNewWindow -FilePath "python" -ArgumentList "server.py"`
|
- Der Server (server.py) wird immer unsichtbar gestartet: `Start-Process -NoNewWindow -FilePath "python" -ArgumentList "server.py"`
|
||||||
- Bei Updates (Polling/Code-Änderungen) niemals den aktuell angezeigten Zug wechseln. Der Benutzer bleibt auf dem von ihm ausgewählten Zug.
|
- Bei Updates (Polling/Code-Änderungen) niemals den aktuell angezeigten Zug wechseln. Der Benutzer bleibt auf dem von ihm ausgewählten Zug.
|
||||||
- Nach jeder Code-Änderung muss die Doku (README.md) auf Richtigkeit und Vollständigkeit geprüft und bei Bedarf aktualisiert werden (Features, Projektstruktur, Konfiguration, Umgebungsvariablen, Technik-Tabelle).
|
- Nach jeder Code-Änderung muss die Doku (README.md) auf Richtigkeit und Vollständigkeit geprüft und bei Bedarf aktualisiert werden (Features, Projektstruktur, Konfiguration, Umgebungsvariablen, Technik-Tabelle).
|
||||||
|
|
||||||
34
js/data.js
34
js/data.js
@@ -6,14 +6,22 @@
|
|||||||
/* global parsePGN, filterLaraGames, getLiveGame, getTodaysGames, getLatestGame */
|
/* global parsePGN, filterLaraGames, getLiveGame, getTodaysGames, getLatestGame */
|
||||||
|
|
||||||
async function fetchRoundPGN(round) {
|
async function fetchRoundPGN(round) {
|
||||||
const res = await fetch(`https://www.deutsche-schachjugend.de/2026/odjm-d/partien/${round}.pgn?t=${Date.now()}`);
|
try {
|
||||||
if (!res.ok) return null;
|
const res = await fetch(`https://www.deutsche-schachjugend.de/2026/odjm-d/partien/${round}.pgn?t=${Date.now()}`);
|
||||||
const buf = await res.arrayBuffer();
|
if (!res.ok) {
|
||||||
let text = new TextDecoder('utf-8').decode(buf);
|
console.error(`Fehler beim Abrufen der Runde ${round}: HTTP ${res.status}`);
|
||||||
if (text.includes('\uFFFD')) {
|
return null;
|
||||||
text = new TextDecoder('iso-8859-1').decode(buf);
|
}
|
||||||
|
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) {
|
async function loadPGN(showOverlay = true) {
|
||||||
@@ -41,6 +49,7 @@ async function loadPGN(showOverlay = true) {
|
|||||||
allLaraGames = filterLaraGames(allGames);
|
allLaraGames = filterLaraGames(allGames);
|
||||||
|
|
||||||
if (allLaraGames.length === 0) {
|
if (allLaraGames.length === 0) {
|
||||||
|
console.warn('Keine Spiele gefunden für die aktuellen Runden');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +76,8 @@ async function loadPGN(showOverlay = true) {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (currentPollId !== pollId) return;
|
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);
|
showLoading(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,7 +85,10 @@ async function loadPGN(showOverlay = true) {
|
|||||||
async function updateStandings() {
|
async function updateStandings() {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`https://www.deutsche-schachjugend.de/2026/odjm-d/tabelle/?t=${Date.now()}`);
|
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 html = await res.text();
|
||||||
|
|
||||||
const roundMatch = html.match(/Tabellenstand\s+nach\s+der\s+(\d+)\.\s*Runde/);
|
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>';
|
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>';
|
document.getElementById('standings-content').innerHTML = '<div class="standings-loading">Daten nicht verfügbar</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user