From 27b7b373b97e0a6092bcc98152306f24a8e544e7 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 6 Oct 2025 11:49:46 -0600 Subject: [PATCH] Correctly handle videos with no subtitles --- src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5675e52..8745fd7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -471,7 +471,12 @@ impl App { }; self.text_codes.push(TextCode { id: Some(i), name }); } - self.current_text = Some(pipeline.property::("current-text")); + let current_text = pipeline.property::("current-text"); + if current_text >= 0 { + self.current_text = Some(current_text); + } else { + self.current_text = None; + } self.update_flags(); self.update_mpris_meta(); @@ -659,7 +664,6 @@ impl App { }; let pipeline = video.pipeline(); let flags_value = pipeline.property_value("flags"); - println!("original flags {:?}", flags_value); match flags_value.transform::() { Ok(flags_transform) => match flags_transform.get::() { Ok(mut flags) => { @@ -684,7 +688,6 @@ impl App { log::warn!("failed to transform flags to int: {err}"); } } - println!("updated flags {:?}", pipeline.property_value("flags")); } fn update_mpris_meta(&mut self) {