fix(arr): recover lost fixtures and align provider names
The Podnapisi zip fixtures never reached the branch: a global gitignore excludes *.zip, so git add skipped them silently and the worker's CI passed against untracked files. Recovered, with a fixtures .gitignore that keeps the next binary fixture from vanishing the same way. Two providers landing in parallel also disagreed on names and on which crate dependencies each integration-test target uses. PodnapisiProvider is now Podnapisi, matching OpenSubtitles, and both test targets declare the dependencies they do not use so the per-target lint stays quiet.
This commit is contained in:
@@ -39,9 +39,7 @@ pub use model::{
|
||||
Candidate, CandidateId, Fetched, MediaFile, MediaRef, ProviderId, SearchRequest, SubtitleFormat,
|
||||
};
|
||||
pub use opensubtitles::{moviehash, OpenSubtitles, OpenSubtitlesConfig};
|
||||
pub use podnapisi::{
|
||||
PodnapisiProvider, PodnapisiProviderBuilder, DEFAULT_BASE_URL as PODNAPISI_DEFAULT_BASE_URL,
|
||||
};
|
||||
pub use podnapisi::{Podnapisi, PodnapisiBuilder, DEFAULT_BASE_URL as PODNAPISI_DEFAULT_BASE_URL};
|
||||
pub use srt::Cue;
|
||||
pub use translate::{Backend, BackendId, Batch, BatchCue, TranslateFuture, TranslatedCue};
|
||||
|
||||
|
||||
@@ -48,12 +48,12 @@ fn provider_id() -> ProviderId {
|
||||
|
||||
/// The Podnapisi.net subtitle provider.
|
||||
#[derive(Debug)]
|
||||
pub struct PodnapisiProvider {
|
||||
pub struct Podnapisi {
|
||||
http: reqwest::Client,
|
||||
base_url: Url,
|
||||
}
|
||||
|
||||
impl PodnapisiProvider {
|
||||
impl Podnapisi {
|
||||
/// A provider against the real Podnapisi.net, with default timeouts.
|
||||
///
|
||||
/// # Errors
|
||||
@@ -65,8 +65,8 @@ impl PodnapisiProvider {
|
||||
|
||||
/// Start configuring a provider.
|
||||
#[must_use]
|
||||
pub fn builder() -> PodnapisiProviderBuilder {
|
||||
PodnapisiProviderBuilder {
|
||||
pub fn builder() -> PodnapisiBuilder {
|
||||
PodnapisiBuilder {
|
||||
base_url: DEFAULT_BASE_URL.to_owned(),
|
||||
timeout: DEFAULT_TIMEOUT,
|
||||
}
|
||||
@@ -237,7 +237,7 @@ fn config_error(detail: String) -> Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl Provider for PodnapisiProvider {
|
||||
impl Provider for Podnapisi {
|
||||
fn id(&self) -> ProviderId {
|
||||
provider_id()
|
||||
}
|
||||
@@ -257,14 +257,14 @@ impl Provider for PodnapisiProvider {
|
||||
}
|
||||
}
|
||||
|
||||
/// Configuration for a [`PodnapisiProvider`].
|
||||
/// Configuration for a [`Podnapisi`].
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct PodnapisiProviderBuilder {
|
||||
pub struct PodnapisiBuilder {
|
||||
base_url: String,
|
||||
timeout: Duration,
|
||||
}
|
||||
|
||||
impl PodnapisiProviderBuilder {
|
||||
impl PodnapisiBuilder {
|
||||
/// Point the provider somewhere other than Podnapisi.net. Tests use
|
||||
/// this; nothing else should.
|
||||
#[must_use]
|
||||
@@ -286,7 +286,7 @@ impl PodnapisiProviderBuilder {
|
||||
///
|
||||
/// [`Error::Config`] if the base URL will not parse or the HTTP client
|
||||
/// cannot be built.
|
||||
pub fn build(self) -> Result<PodnapisiProvider> {
|
||||
pub fn build(self) -> Result<Podnapisi> {
|
||||
let mut base_url = self.base_url;
|
||||
if !base_url.ends_with('/') {
|
||||
base_url.push('/');
|
||||
@@ -305,7 +305,7 @@ impl PodnapisiProviderBuilder {
|
||||
detail: err.to_string(),
|
||||
})?;
|
||||
|
||||
Ok(PodnapisiProvider { http, base_url })
|
||||
Ok(Podnapisi { http, base_url })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
|
||||
// Same per-target quirk as in `lib.rs`: an integration test links the library's
|
||||
// dependencies without using them directly.
|
||||
use {arr_parse as _, reqwest as _, serde as _, thiserror as _, tracing as _};
|
||||
use {
|
||||
arr_parse as _, chardetng as _, encoding_rs as _, reqwest as _, serde as _, thiserror as _,
|
||||
tracing as _, zip as _,
|
||||
};
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
// Same per-target quirk as the crate's own tests: an integration test links
|
||||
// the library's dependencies without using them all directly.
|
||||
use {
|
||||
arr_parse as _, reqwest as _, serde as _, serde_json as _, thiserror as _, tracing as _,
|
||||
zip as _,
|
||||
arr_parse as _, chardetng as _, encoding_rs as _, reqwest as _, serde as _, serde_json as _,
|
||||
tempfile as _, thiserror as _, tracing as _, zip as _,
|
||||
};
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
use arr_core::Language;
|
||||
use arr_subs::{
|
||||
Candidate, Error, Fetched, MediaFile, MediaRef, PodnapisiProvider, Provider, SearchRequest,
|
||||
Candidate, Error, Fetched, MediaFile, MediaRef, Podnapisi, Provider, SearchRequest,
|
||||
SubtitleFormat,
|
||||
};
|
||||
use wiremock::matchers::{method, path, query_param, query_param_is_missing};
|
||||
@@ -25,8 +25,8 @@ const SEARCH_MALFORMED: &str = include_str!("fixtures/search_malformed.json");
|
||||
const DOWNLOAD_ZIP: &[u8] = include_bytes!("fixtures/download.zip");
|
||||
const DOWNLOAD_MULTI_ZIP: &[u8] = include_bytes!("fixtures/download_multi.zip");
|
||||
|
||||
fn provider(server: &MockServer) -> PodnapisiProvider {
|
||||
PodnapisiProvider::builder()
|
||||
fn provider(server: &MockServer) -> Podnapisi {
|
||||
Podnapisi::builder()
|
||||
.base_url(format!("{}/subtitles", server.uri()))
|
||||
.build()
|
||||
.expect("provider builds")
|
||||
|
||||
Reference in New Issue
Block a user