feat(arr): convert VTT and ASS downloads to SRT

This commit is contained in:
Miguel Palhas
2026-08-24 23:13:25 +01:00
parent b9f4ee98d5
commit 8450b06e76
3 changed files with 353 additions and 1 deletions
+14 -1
View File
@@ -2,7 +2,7 @@
use std::{path::PathBuf, time::Duration};
use crate::model::{CandidateId, ProviderId};
use crate::model::{CandidateId, ProviderId, SubtitleFormat};
/// Result alias for every fallible operation in this crate.
pub type Result<T> = std::result::Result<T, Error>;
@@ -88,6 +88,19 @@ pub enum Error {
detail: String,
},
/// A downloaded subtitle could not be converted to SRT (DESIGN.md §15):
/// its format is [`SubtitleFormat::Other`], or its own parser rejected
/// the text.
#[error("{candidate} could not be converted from {format} to SRT: {detail}")]
Convert {
/// The candidate whose bytes failed to convert.
candidate: CandidateId,
/// The format conversion was attempted from.
format: SubtitleFormat,
/// What was wrong, short enough to log.
detail: String,
},
/// The provider could not be constructed: a bad base URL, or its HTTP
/// client failed to build. Always a caller bug — a hardcoded URL or a
/// test override — never a fact about the live service.