refactor: Used is_multiple_of to make life easier and cleaner in the app module

This commit is contained in:
2025-12-09 14:28:09 -07:00
parent b807904c6c
commit d47dadeb88
3 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -161,7 +161,10 @@ impl App<'_> {
}
pub async fn on_tick(&mut self) {
if self.tick_count % self.tick_until_poll == 0 || self.is_routing || self.should_refresh {
if self.tick_count.is_multiple_of(self.tick_until_poll)
|| self.is_routing
|| self.should_refresh
{
match self.get_current_route() {
Route::Radarr(active_radarr_block, _) => self.radarr_on_tick(active_radarr_block).await,
Route::Sonarr(active_sonarr_block, _) => self.sonarr_on_tick(active_sonarr_block).await,
+1 -1
View File
@@ -185,7 +185,7 @@ impl App<'_> {
}
}
if self.tick_count % self.tick_until_poll == 0 {
if self.tick_count.is_multiple_of(self.tick_until_poll) {
self.refresh_radarr_metadata().await;
}
}
+1 -1
View File
@@ -214,7 +214,7 @@ impl App<'_> {
}
}
if self.tick_count % self.tick_until_poll == 0 {
if self.tick_count.is_multiple_of(self.tick_until_poll) {
self.refresh_sonarr_metadata().await;
}
}