Skip to content

Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.

fix(app): reset playback flag in every launch path

Samir Hossains6e748f5c5aab
diff --git a/src/history.rs b/src/history.rs
index 3e32ea2..2c7e7f0 100644
--- a/src/history.rs
+++ b/src/history.rs
@@ -16,7 +16,7 @@ pub struct WatchHistoryItem {
pub timestamp: u64,
}
-#[derive(Default, Serialize, Deserialize)]
+#[derive(Default, Clone, Serialize, Deserialize)]
pub struct HistoryManager {
watched: HashSet<String>,
#[serde(default)]
@@ -72,8 +72,6 @@ impl HistoryManager {
let excess = self.recent.len() - 100;
self.recent.drain(0..excess);
}
-
- self.save();
}
pub fn is_watched(
diff --git a/src/tui/app.rs b/src/tui/app.rs
index f873d8b..d48cb7e 100644
--- a/src/tui/app.rs
+++ b/src/tui/app.rs
@@ -211,6 +211,8 @@ impl App {
episode,
timestamp,
});
+ let history = self.state.history.clone();
+ tokio::task::spawn_blocking(move || history.save());
self.state.dirty = true;
}
@@ -4700,6 +4702,7 @@ impl App {
}
Action::ShowPlaybackPicker(source) => {
+ self.state.is_resolving_playback = false;
if self.state.available_players.is_empty() {
self.state
.set_status("No media player found. Install mpv, IINA, or VLC.", 150);
@@ -4739,6 +4742,7 @@ impl App {
self.launch_player(kind, link, sub, Vec::new());
}
Action::LaunchPlayback(kind, source) => {
+ self.state.is_resolving_playback = false;
self.state.player_picker_popup = false;
if !crate::tui::player::supports_headers(kind, &source.headers) {
self.state.set_status(