fix: recognize stock calibre software with the diagnostic tool

This commit is contained in:
Daniel
2026-06-22 12:40:17 +02:00
parent 153b85d4c8
commit 669777b999
3 changed files with 29 additions and 6 deletions
@@ -54,10 +54,32 @@ class _ConnectionDiagnosticsPageState extends State<ConnectionDiagnosticsPage> {
return buffer.toString();
}
DiagnosticResult? _resultFor(DiagnosticProbeId id) {
for (final r in _results) {
if (r.id == id) return r;
}
return null;
}
bool _looksLikeStockCalibre() {
final root = _resultFor(DiagnosticProbeId.serverReachable);
final ajax = _resultFor(DiagnosticProbeId.bookList);
final stats = _resultFor(DiagnosticProbeId.opdsStats);
if (root == null || ajax == null || stats == null) return false;
return root.verdict == ProbeVerdict.ok &&
ajax.statusCode == 404 &&
stats.statusCode == 404;
}
String? _interpretation(AppLocalizations l) {
final ajax = _results.where((r) => r.id == DiagnosticProbeId.bookList);
if (ajax.isEmpty) return null;
switch (ajax.first.verdict) {
final ajax = _resultFor(DiagnosticProbeId.bookList);
if (ajax == null) return null;
if (_looksLikeStockCalibre()) {
return l.diagHintStockCalibre;
}
switch (ajax.verdict) {
case ProbeVerdict.ok:
return l.diagHintOk;
case ProbeVerdict.redirect:
+2 -2
View File
@@ -486,11 +486,11 @@
"diagProbeOpdsStats": "OPDS-Statistik",
"diagProbeCoverImage": "Coverbild",
"diagHintOk": "Der Daten-Endpunkt funktioniert. Falls die App trotzdem keine Bücher zeigt, prüfe die Bibliotheks-/Servertyp-Auswahl.",
"diagHintBlocked": "Der Daten-Endpunkt wird von einer Auth-Ebene abgefangen (Reverse Proxy / SSO). OPDS (HTTP Basic) funktioniert evtl. noch, aber die AJAX-Endpunkte brauchen eine echte Proxy-Sitzung nutze SSO-Login oder einen Header-Token-Bypass.",
"diagHintBlocked": "Der Daten-Endpunkt wird von einer Auth-Ebene abgefangen (Reverse Proxy / SSO). OPDS (HTTP Basic) funktioniert evtl. noch, aber die AJAX-Endpunkte brauchen ein gültiges Session-Cookie. Hinter einem Reverse Proxy: „Session protection“ in Calibre-Web auf Basic stellen und X-Forwarded-For durchreichen; andernfalls SSO-Login nutzen.",
"diagHintAuth": "Der Server hat die Sitzung abgelehnt (401/403). Melde dich neu an. Falls „Strong session protection“ aktiv ist, bindet sie die Sitzung an IP + User-Agent.",
"diagHintServerError": "Der Server lieferte einen 5xx-Fehler für den Daten-Endpunkt.",
"diagHintUnreachable": "Der Daten-Endpunkt konnte nicht erreicht werden.",
"magicShelves": "Magic Shelves",
"diagHintStockCalibre": "Der Server antwortet, aber die Calibre-Web-Endpunkte (/ajax/listbooks, /opds/stats) liefern 404. Das sieht nach dem eingebauten Calibre-Content-Server aus, nicht nach Calibre-Web. Diese App benötigt Calibre-Web oder Calibre-Web-Automated, das auf dieselbe Bibliothek zeigt.",
"duplicateShelf": "Duplizieren",
"hideShelf": "Ausblenden",
"magicShelfDeleted": "Magic Shelf gelöscht",
+2 -1
View File
@@ -489,10 +489,11 @@
"diagProbeOpdsStats": "OPDS stats",
"diagProbeCoverImage": "Cover image",
"diagHintOk": "The data endpoint works. If the app still shows no books, check the library / server-type selection.",
"diagHintBlocked": "The data endpoint is intercepted by an auth layer (reverse proxy / SSO). OPDS (HTTP Basic) may still work, but the AJAX endpoints need a real proxy session — use SSO login or a header-token bypass.",
"diagHintBlocked": "The data endpoint is intercepted by an auth layer (reverse proxy / SSO). OPDS (HTTP Basic) may still work, but the AJAX endpoints need a valid session cookie. Behind a reverse proxy, set \"Session protection\" to Basic in Calibre-Web and pass X-Forwarded-For through; otherwise use SSO login.",
"diagHintAuth": "The server rejected the session (401/403). Re-login. If \"Strong session protection\" is enabled, it binds the session to IP + User-Agent.",
"diagHintServerError": "The server returned a 5xx error for the data endpoint.",
"diagHintUnreachable": "The data endpoint could not be reached.",
"diagHintStockCalibre": "The server responds, but the Calibre-Web endpoints (/ajax/listbooks, /opds/stats) return 404. This looks like the built-in Calibre Content Server, not Calibre-Web. This app needs Calibre-Web or Calibre-Web-Automated pointed at the same library.",
"magicShelves": "Magic Shelves",
"duplicateShelf": "Duplicate",
"hideShelf": "Hide",