refactor(subs): remove podnapisi
This commit is contained in:
@@ -275,8 +275,6 @@ async fn probe_subtitles(state: &AppState) -> SubtitleHealth {
|
||||
async fn probe_provider(state: &AppState, id: &str) -> ProviderCheck {
|
||||
let check = match state.subtitle_provider(id) {
|
||||
Some(provider) => check_from(provider.probe().await),
|
||||
// Only reachable for a provider that needs credentials: Podnapisi is
|
||||
// anonymous (#215) and is always attached, so it never lands here.
|
||||
None => Check::unconfigured(format!(
|
||||
"{id} is enabled but has no credentials — they are bootstrap config, not a setting"
|
||||
)),
|
||||
@@ -481,15 +479,13 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn an_enabled_provider_without_credentials_is_unconfigured() {
|
||||
let (_dir, state) = application().await;
|
||||
// The seed row enables opensubtitles and podnapisi; none are attached.
|
||||
// The seed row enables OpenSubtitles; none is attached.
|
||||
let body = report(state).await;
|
||||
assert_eq!(
|
||||
body["subtitles"]["providers"],
|
||||
serde_json::json!([
|
||||
{ "id": "opensubtitles", "status": "unconfigured",
|
||||
"detail": "opensubtitles is enabled but has no credentials — they are bootstrap config, not a setting" },
|
||||
{ "id": "podnapisi", "status": "unconfigured",
|
||||
"detail": "podnapisi is enabled but has no credentials — they are bootstrap config, not a setting" },
|
||||
])
|
||||
);
|
||||
assert_eq!(body["status"], "degraded");
|
||||
|
||||
@@ -400,7 +400,7 @@ mod tests {
|
||||
fn valid_input() -> serde_json::Value {
|
||||
serde_json::json!({
|
||||
"wanted_languages": ["pt-PT", "en"],
|
||||
"providers_enabled": ["opensubtitles", "podnapisi"],
|
||||
"providers_enabled": ["opensubtitles"],
|
||||
"translation_engine": null,
|
||||
"provider_daily_budgets": { "opensubtitles": 100 },
|
||||
"translator_daily_budgets": {},
|
||||
@@ -423,7 +423,7 @@ mod tests {
|
||||
);
|
||||
assert_eq!(
|
||||
settings["providers_enabled"],
|
||||
serde_json::json!(["opensubtitles", "podnapisi"])
|
||||
serde_json::json!(["opensubtitles"])
|
||||
);
|
||||
assert!(settings["translation_engine"].is_null());
|
||||
// `available_engines` is a fact about the build, not about the seed
|
||||
|
||||
@@ -2609,7 +2609,7 @@ mod tests {
|
||||
async fn a_grab_naming_an_unconfigured_provider_is_a_422() {
|
||||
let fixture = stub_application().await;
|
||||
let mut body = pt();
|
||||
body["provider"] = serde_json::json!("podnapisi");
|
||||
body["provider"] = serde_json::json!("unconfigured");
|
||||
let (status, _) = grab(&fixture, body).await;
|
||||
assert_eq!(status, StatusCode::UNPROCESSABLE_ENTITY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user