Surface clearer error when adding a Piped frontend URL

Pointing AddRemoteServer at a Piped Vue SPA (e.g. the frontend host
rather than the API host) used to fail with a generic
"could not detect instance type" — every JSON probe got the same
index.html back. On the failure path, fetch `/` once more and look
for `<title>Piped</title>`; if matched, return a new
`pipedFrontendDetected` error that tells the user to enter the
Piped API URL instead.
This commit is contained in:
Arkadiusz Fal
2026-05-06 21:14:50 +02:00
parent e3f4d764cc
commit 411fcba037
2 changed files with 40 additions and 0 deletions

View File

@@ -15094,6 +15094,17 @@
}
}
},
"sources.error.pipedFrontendDetected" : {
"comment" : "Error when the URL points to the Piped web frontend (SPA) instead of its API backend. The frontend serves the same index.html for every path so detection cannot succeed.",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "This URL is the Piped web frontend, not its API. Please enter the Piped API URL instead (for example, the frontend may be at piped.example.com while the API is at piped-api.example.com or pipedapi.example.com — check with the instance operator)."
}
}
}
},
"sources.error.couldNotDetect" : {
"comment" : "Error when source type could not be detected",
"localizations" : {