From c8b942b1fbe8fdab1db0e0f56d3ed86a7486b578 Mon Sep 17 00:00:00 2001 From: Malte Voos Date: Thu, 1 Jan 2026 19:26:01 +0100 Subject: cache extracted subtitles & deepl translations --- src/subtitles/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/subtitles/mod.rs') diff --git a/src/subtitles/mod.rs b/src/subtitles/mod.rs index acb73dc..de747f1 100644 --- a/src/subtitles/mod.rs +++ b/src/subtitles/mod.rs @@ -4,6 +4,7 @@ pub mod state; use std::collections::BTreeMap; use relm4::SharedState; +use serde::{Deserialize, Serialize}; pub type StreamIndex = usize; @@ -26,7 +27,7 @@ pub struct SubtitleCue { pub end_time: gst::ClockTime, } -#[derive(Default, Debug, Clone)] +#[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct SubtitleTrack { // SoA of cue text, start timestamp, end timestamp pub texts: Vec, @@ -34,7 +35,9 @@ pub struct SubtitleTrack { pub end_times: Vec, } -pub static SUBTITLE_TRACKS: SharedState> = SharedState::new(); +pub type SubtitleTrackCollection = BTreeMap; + +pub static SUBTITLE_TRACKS: SharedState = SharedState::new(); impl TrackMetadata { pub fn from_ffmpeg_stream(stream: &ffmpeg::Stream) -> Self { -- cgit 1.4.1