feat(arr): convert VTT and ASS downloads to SRT
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user