aboutsummaryrefslogtreecommitdiff
path: root/src/subtitles/mod.rs
diff options
context:
space:
mode:
authorMalte Voos <git@mal.tc>2026-01-01 19:26:01 +0100
committerMalte Voos <git@mal.tc>2026-01-04 00:38:38 +0100
commitc8b942b1fbe8fdab1db0e0f56d3ed86a7486b578 (patch)
treecf344838c96ad9bd7bd97d0216c43d6a858f4a60 /src/subtitles/mod.rs
parent80a1c8234fc5b6f56bd1f2df4e6118e57631f523 (diff)
downloadlleap-c8b942b1fbe8fdab1db0e0f56d3ed86a7486b578.tar.gz
lleap-c8b942b1fbe8fdab1db0e0f56d3ed86a7486b578.zip
cache extracted subtitles & deepl translationsHEADmain
Diffstat (limited to 'src/subtitles/mod.rs')
-rw-r--r--src/subtitles/mod.rs7
1 files changed, 5 insertions, 2 deletions
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<String>,
@@ -34,7 +35,9 @@ pub struct SubtitleTrack {
pub end_times: Vec<gst::ClockTime>,
}
-pub static SUBTITLE_TRACKS: SharedState<BTreeMap<StreamIndex, SubtitleTrack>> = SharedState::new();
+pub type SubtitleTrackCollection = BTreeMap<StreamIndex, SubtitleTrack>;
+
+pub static SUBTITLE_TRACKS: SharedState<SubtitleTrackCollection> = SharedState::new();
impl TrackMetadata {
pub fn from_ffmpeg_stream(stream: &ffmpeg::Stream) -> Self {