Skip to content

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

fix(update): defer check timestamp on success

Samir Hossainsd7be4ccdc886
diff --git a/src/tui/app/run.rs b/src/tui/app/run.rs
index f673625..0cc8ffd 100644
--- a/src/tui/app/run.rs
+++ b/src/tui/app/run.rs
@@ -42,9 +42,7 @@ impl App {
.as_secs();
if self.state.auto_update && now.saturating_sub(self.state.last_update_check) > 3600 {
- self.state.last_update_check = now;
self.state.manual_update_check = false;
- self.persist_config();
self.action_sender.send(Action::CheckForUpdates).ok();
}
self.state.active_screen = Screen::Home;
diff --git a/src/tui/app/system.rs b/src/tui/app/system.rs
index 9259227..fe03833 100644
--- a/src/tui/app/system.rs
+++ b/src/tui/app/system.rs
@@ -308,6 +308,11 @@ impl App {
}
if version == "none" {
+ self.state.last_update_check = std::time::SystemTime::now()
+ .duration_since(std::time::UNIX_EPOCH)
+ .unwrap_or_default()
+ .as_secs();
+ self.persist_config();
if self.state.manual_update_check {
self.state.notify(
NotificationKind::Success,
@@ -327,6 +332,11 @@ impl App {
}
self.state.manual_update_check = false;
} else {
+ self.state.last_update_check = std::time::SystemTime::now()
+ .duration_since(std::time::UNIX_EPOCH)
+ .unwrap_or_default()
+ .as_secs();
+ self.persist_config();
self.state.manual_update_check = false;
self.state.update_available = Some((version, notes));
}