Compare commits

...
10 Commits
Author SHA1 Message Date
Alex Clarke e779f70187 Merge pull request #63 from JMcCumberIO/fix/tui-idle-cpu-and-error-banners
Check / stable / fmt (push) Failing after 30s
Check / beta / clippy (push) Failing after 1m17s
Check / stable / clippy (push) Failing after 1m21s
Check / nightly / doc (push) Successful in 1m7s
Check / 1.95.0 / check (push) Successful in 1m9s
Test Suite / ubuntu / beta (push) Successful in 1m51s
Test Suite / ubuntu / stable (push) Successful in 1m52s
Test Suite / ubuntu / stable / coverage (push) Failing after 2m27s
Test Suite / macos-latest / stable (push) Has been cancelled
Test Suite / windows-latest / stable (push) Has been cancelled
fix: reduce TUI idle CPU and improve server error banners
2026-07-06 08:58:06 -06:00
Jonathan McCumberandClaude Sonnet 4.6 a9054d9a98 chore: cargo fmt --all
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-06 09:18:50 -05:00
Jonathan McCumberandClaude Sonnet 4.6 645ca19d76 fix: address reviewer feedback — rename scroll field to bool, relocate static, drop env var
- Rename `ui_scroll_tick_count: u64` → `should_text_scroll: bool` across all 33
  call sites; `on_ui_scroll_tick` now assigns true/false instead of 0/1
- Remove two now-redundant comments from `test_on_ui_scroll_tick`
- Move `WHITESPACE_RE` static declaration below module imports in network/mod.rs
- Remove `MANAGARR_TICK_RATE_MS` env var and its parsing helpers; `recv()`-based
  blocking already brings idle CPU to near-0, and tuning tick rate silently
  stretches the poll cadence — keep `DEFAULT_TICK_RATE_MS` const only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3FpbniZme9mJqgFkMVowz
2026-07-04 20:30:20 -05:00
Jonathan McCumberandClaude Sonnet 4.6 6f697f64f4 fix: revert draw gating; replace frame-count scroll with wall-clock timer
- Revert src/main.rs to draw-at-top-of-loop (original structure) so
  auto-scrolling is no longer coupled to event rate. Lock is released
  before blocking on recv() so the network task is never starved.

- Replace ticks_until_scroll counter in on_ui_scroll_tick() with an
  Instant + Duration (default 100ms). Scroll now advances at a fixed
  wall-clock rate (10 chars/sec) regardless of draw rate or tick rate,
  which is the correct long-term fix for the animation regression.

- Update tests: assert scroll_interval == 100ms in default/new tests;
  rewrite test_on_ui_scroll_tick to cover zero-interval (always fires)
  and long-interval (suppressed) cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3FpbniZme9mJqgFkMVowz
2026-06-30 20:05:00 -05:00
Jonathan McCumber a72b2991fd fix: address reviewer feedback — regex OnceLock and restore tick rate
- Compile whitespace regex once via OnceLock instead of on every
  non-success response; makes format_error_body infallible (String
  return, no Result) eliminating the only practical failure mode
- Revert default tick rate from 100ms back to 50ms to preserve the
  existing 20-second Servarr poll cadence (tick_until_poll=400 × 50ms);
  the recv() change is the real CPU fix — the tick rate change was
  unnecessary and silently halved the data refresh rate
- Keep MANAGARR_TICK_RATE_MS as opt-in override; note that tuning it
  proportionally stretches the poll interval alongside the tick rate
2026-06-28 13:00:16 -05:00
Jonathan McCumber 6c41e0704e fix: reduce TUI idle CPU and improve server error banners
- Replace non-blocking try_recv() event loop with blocking recv() to
  eliminate idle spin; the sender tick timeout still drives minimum
  wakeup rate so the UI stays responsive
- Lower default tick rate from 50 ms to 100 ms (10 ticks/sec vs 20);
  add MANAGARR_TICK_RATE_MS env var for runtime tuning
- Move terminal draws to event boundaries (key + tick) instead of every
  loop pass, reducing unnecessary redraws
- In network error handling, prefer concise JSON fields (message /
  errorMessage / error) over the raw HTTP body, so Radarr ASP.NET
  stack traces don't flood the TUI banner; full body still logged
- Add unit tests for tick-rate parsing and Radarr-style JSON error body

Observed: ~0.6% total CPU at idle vs measurably higher with prod defaults
2026-06-28 12:35:37 -05:00
Dark-Alex-17 6e7707f6df build: upgraded MSRV in the Dockerfile 2026-06-25 15:41:56 -06:00
github-actions[bot] a26444006b chore: bump Cargo.toml to 0.7.3
Check / stable / fmt (push) Failing after 27s
Check / beta / clippy (push) Failing after 1m13s
Check / stable / clippy (push) Failing after 1m15s
Check / nightly / doc (push) Successful in 1m3s
Check / 1.95.0 / check (push) Successful in 1m9s
Test Suite / ubuntu / beta (push) Successful in 1m47s
Test Suite / ubuntu / stable (push) Successful in 1m47s
Test Suite / ubuntu / stable / coverage (push) Failing after 2m24s
Test Suite / macos-latest / stable (push) Has been cancelled
Test Suite / windows-latest / stable (push) Has been cancelled
2026-06-25 20:58:11 +00:00
github-actions[bot] ccf3e28323 bump: version 0.7.2 → 0.7.3 [skip ci] 2026-06-25 20:58:10 +00:00
Alex Clarke 6eea6b92fb Merge pull request #62 from Dark-Alex-17/develop
Security fixes, rolling logs, and Rust version upgrade
2026-06-25 14:37:16 -06:00
36 changed files with 166 additions and 68 deletions
+15
View File
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v0.7.3 (2026-06-25)
### Feat
- Implemented log rolling so the log file doesn't just grow exponentially [#60]
### Fix
- addressed code review comments
- tail-logs subcommand follows log rollovers and sleeps to minimize idle CPU loops
### Refactor
- Refactored several usages of sort_by_key and match guards to utilize newer Rust version APIs
## v0.7.2 (2026-04-20)
### Feat
Generated
+3 -3
View File
@@ -93,9 +93,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.102"
version = "1.0.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3"
[[package]]
name = "approx"
@@ -1844,7 +1844,7 @@ dependencies = [
[[package]]
name = "managarr"
version = "0.7.2"
version = "0.7.3"
dependencies = [
"anyhow",
"assert_cmd",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "managarr"
version = "0.7.2"
version = "0.7.3"
authors = ["Alex Clarke <alex.j.tusa@gmail.com>"]
description = "A TUI and CLI to manage your Servarrs"
keywords = ["managarr", "ratatui", "dashboard", "servarr", "tui"]
+1 -1
View File
@@ -1,4 +1,4 @@
FROM rust:1.89 AS builder
FROM rust:1.95 AS builder
WORKDIR /usr/src
# Download and compile Rust dependencies in an empty project and cache as a separate Docker layer
+11 -12
View File
@@ -5,6 +5,7 @@ mod tests {
use reqwest::header::{HeaderMap, HeaderName, HeaderValue};
use serde_json::Value;
use serial_test::serial;
use std::time::{Duration, Instant};
use tokio::sync::mpsc;
use crate::app::{App, AppConfig, Data, ServarrConfig, interpolate_env_vars};
@@ -80,9 +81,9 @@ mod tests {
assert_eq!(app.server_tabs.index, 0);
assert_eq!(app.server_tabs.tabs, expected_tab_routes);
assert_eq!(app.tick_until_poll, 400);
assert_eq!(app.ticks_until_scroll, 64);
assert_eq!(app.scroll_interval, Duration::from_millis(100));
assert_eq!(app.tick_count, 0);
assert_eq!(app.ui_scroll_tick_count, 0);
assert!(!app.should_text_scroll);
assert!(!app.is_loading);
assert!(!app.is_routing);
assert!(!app.should_refresh);
@@ -101,7 +102,7 @@ mod tests {
assert_eq!(app.error, HorizontallyScrollableText::default());
assert_eq!(app.server_tabs.index, 0);
assert_eq!(app.tick_until_poll, 400);
assert_eq!(app.ticks_until_scroll, 64);
assert_eq!(app.scroll_interval, Duration::from_millis(100));
assert_eq!(app.tick_count, 0);
assert!(!app.is_loading);
assert!(!app.is_routing);
@@ -247,22 +248,20 @@ mod tests {
#[test]
fn test_on_ui_scroll_tick() {
let mut app = App {
ticks_until_scroll: 1,
scroll_interval: Duration::ZERO,
..App::default()
};
assert_eq!(app.ui_scroll_tick_count, 0);
assert_eq!(app.tick_count, 0);
app.on_ui_scroll_tick();
assert!(app.should_text_scroll);
app.on_ui_scroll_tick();
assert!(app.should_text_scroll);
assert_eq!(app.ui_scroll_tick_count, 1);
assert_eq!(app.tick_count, 0);
app.scroll_interval = Duration::from_secs(60);
app.last_scroll = Instant::now();
app.on_ui_scroll_tick();
assert_eq!(app.ui_scroll_tick_count, 0);
assert_eq!(app.tick_count, 0);
assert!(!app.should_text_scroll);
}
#[tokio::test]
+11 -7
View File
@@ -7,6 +7,7 @@ use reqwest::header::{HeaderMap, HeaderName, HeaderValue};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::path::PathBuf;
use std::time::{Duration, Instant};
use std::{fs, process};
use tokio::sync::mpsc::Sender;
use tokio_util::sync::CancellationToken;
@@ -41,9 +42,10 @@ pub struct App<'a> {
pub error: HorizontallyScrollableText,
pub notification: Option<Notification>,
pub tick_until_poll: u64,
pub ticks_until_scroll: u64,
pub scroll_interval: Duration,
pub last_scroll: Instant,
pub tick_count: u64,
pub ui_scroll_tick_count: u64,
pub should_text_scroll: bool,
pub is_routing: bool,
pub is_loading: bool,
pub should_refresh: bool,
@@ -171,10 +173,11 @@ impl App<'_> {
}
pub fn on_ui_scroll_tick(&mut self) {
if self.ui_scroll_tick_count == self.ticks_until_scroll {
self.ui_scroll_tick_count = 0;
if self.last_scroll.elapsed() >= self.scroll_interval {
self.should_text_scroll = true;
self.last_scroll = Instant::now();
} else {
self.ui_scroll_tick_count += 1;
self.should_text_scroll = false;
}
}
@@ -260,9 +263,10 @@ impl Default for App<'_> {
is_first_render: true,
server_tabs: TabState::new(Vec::new()),
tick_until_poll: 400,
ticks_until_scroll: 64,
scroll_interval: Duration::from_millis(100),
last_scroll: Instant::now(),
tick_count: 0,
ui_scroll_tick_count: 0,
should_text_scroll: false,
is_loading: false,
is_routing: false,
should_refresh: false,
+14 -2
View File
@@ -18,10 +18,12 @@ pub struct Events {
rx: Receiver<InputEvent<Key>>,
}
const DEFAULT_TICK_RATE_MS: u64 = 50;
impl Events {
pub fn new() -> Self {
let (tx, rx) = mpsc::channel();
let tick_rate: Duration = Duration::from_millis(50);
let tick_rate: Duration = Duration::from_millis(DEFAULT_TICK_RATE_MS);
thread::spawn(move || {
let mut last_tick = Instant::now();
@@ -51,9 +53,19 @@ impl Events {
}
pub fn next(&self) -> Result<Option<InputEvent<Key>>> {
match self.rx.try_recv() {
match self.rx.recv() {
Ok(event) => Ok(Some(event)),
_ => Ok(None),
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn defaults_to_original_tick_rate() {
assert_eq!(DEFAULT_TICK_RATE_MS, 50);
}
}
+9 -3
View File
@@ -277,12 +277,15 @@ async fn start_ui(
let input_events = Events::new();
loop {
{
let mut app = app.lock().await;
terminal.draw(|f| ui(f, &mut app))?;
}
match input_events.next()? {
Some(InputEvent::KeyEvent(key)) => {
let mut app = app.lock().await;
if key == Key::Char('q') && !app.ignore_special_keys_for_textbox_input {
break;
}
@@ -290,8 +293,11 @@ async fn start_ui(
handlers::handle_events(key, &mut app);
}
Some(InputEvent::Tick) => app.on_tick().await,
_ => {}
Some(InputEvent::Tick) => {
let mut app = app.lock().await;
app.on_tick().await;
}
None => break,
}
}
+22 -5
View File
@@ -1,5 +1,5 @@
use std::fmt::Debug;
use std::sync::Arc;
use std::sync::{Arc, OnceLock};
use anyhow::{Result, anyhow};
use async_trait::async_trait;
@@ -9,6 +9,7 @@ use regex::Regex;
use reqwest::{Client, RequestBuilder};
use serde::Serialize;
use serde::de::DeserializeOwned;
use serde_json::Value;
use sonarr_network::SonarrEvent;
use strum_macros::Display;
use tokio::select;
@@ -32,6 +33,8 @@ mod network_tests;
#[cfg(test)]
pub mod servarr_test_utils;
static WHITESPACE_RE: OnceLock<Regex> = OnceLock::new();
#[cfg_attr(test, automock)]
#[async_trait]
pub trait NetworkTrait {
@@ -142,11 +145,8 @@ impl<'a, 'b> Network<'a, 'b> {
}
} else {
let status = response.status();
let whitespace_regex = Regex::new(r"\s+")?;
let response_body = response.text().await.unwrap_or_default();
let error_body = whitespace_regex
.replace_all(&response_body.replace('\n', " "), " ")
.to_string();
let error_body = format_error_body(&response_body);
error!("Request failed. Received {status} response code with body: {response_body}");
self.app.lock().await.handle_error(anyhow!("Request failed. Received {status} response code with body: {error_body}"));
@@ -279,6 +279,23 @@ impl<'a, 'b> Network<'a, 'b> {
}
}
fn format_error_body(response_body: &str) -> String {
let re = WHITESPACE_RE.get_or_init(|| Regex::new(r"\s+").unwrap());
let body = serde_json::from_str::<Value>(response_body)
.ok()
.and_then(|value| {
value
.get("message")
.or_else(|| value.get("errorMessage"))
.or_else(|| value.get("error"))
.and_then(Value::as_str)
.map(ToOwned::to_owned)
})
.unwrap_or_else(|| response_body.replace('\n', " "));
re.replace_all(&body, " ").to_string()
}
#[derive(Clone, Copy, Debug, Display, PartialEq, Eq)]
pub enum RequestMethod {
Get,
+45
View File
@@ -353,6 +353,51 @@ mod tests {
);
}
#[tokio::test]
async fn test_handle_request_non_success_code_uses_json_message_for_error_body() {
let mut server = Server::new_async().await;
let async_server = server
.mock("GET", "/test")
.match_header("X-Api-Key", "test1234")
.with_status(500)
.with_body(
json!({
"message": "database is locked\ndatabase is locked",
"description": "at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker"
})
.to_string(),
)
.create_async()
.await;
let app_arc = Arc::new(Mutex::new(App::test_default()));
let mut network = test_network(&app_arc);
let resp = network
.handle_request::<(), Test>(
RequestProps {
uri: format!("{}/test", server.url()),
method: RequestMethod::Get,
body: None,
api_token: "test1234".to_owned(),
ignore_status_code: false,
custom_headers: HeaderMap::new(),
},
|response, mut app| app.error = HorizontallyScrollableText::from(response.value),
)
.await;
async_server.assert_async().await;
assert_str_eq!(
app_arc.lock().await.error.text,
"Request failed. Received 500 Internal Server Error response code with body: database is locked database is locked"
);
assert!(resp.is_err());
assert_str_eq!(
resp.unwrap_err().to_string(),
"Request failed. Received 500 Internal Server Error response code with body: database is locked database is locked"
);
}
#[rstest]
#[tokio::test]
async fn test_call_api(
+1 -1
View File
@@ -88,7 +88,7 @@ fn draw_downloads(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
output_path.as_ref().unwrap().scroll_left_or_reset(
get_width_from_percentage(area, 18),
current_selection == *download_record,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
}
+1 -1
View File
@@ -60,7 +60,7 @@ fn draw_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
source_title.scroll_left_or_reset(
get_width_from_percentage(area, 50),
current_selection == *history_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
@@ -46,7 +46,7 @@ fn draw_test_all_indexers_test_results(f: &mut Frame<'_>, app: &mut App<'_>, are
result.validation_failures.scroll_left_or_reset(
get_width_from_percentage(area, 86),
*result == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let pass_fail = if result.is_valid { "+" } else { "x" };
let row = Row::new(vec![
+1 -1
View File
@@ -112,7 +112,7 @@ fn draw_add_artist_search(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
artist.artist_name.scroll_left_or_reset(
get_width_from_percentage(area, 27),
*artist == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
+2 -2
View File
@@ -250,7 +250,7 @@ fn draw_album_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
source_title.scroll_left_or_reset(
get_width_from_percentage(area, 40),
current_selection == *history_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
@@ -345,7 +345,7 @@ fn draw_album_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
get_width_from_percentage(area, 35),
current_selection == *release
&& active_lidarr_block != ActiveLidarrBlock::ManualAlbumSearchConfirmPrompt,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let size = convert_to_gb(*size);
let rejected_str = if *rejected { "" } else { "" };
@@ -271,7 +271,7 @@ fn draw_albums_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
album.title.scroll_left_or_reset(
get_width_from_percentage(area, 33),
*album == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let monitored = if album.monitored { "🏷" } else { "" };
let album_type = album.album_type.clone().unwrap_or_default();
@@ -376,7 +376,7 @@ fn draw_artist_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
source_title.scroll_left_or_reset(
get_width_from_percentage(area, 40),
current_selection == *history_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
@@ -490,7 +490,7 @@ fn draw_artist_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
get_width_from_percentage(area, 35),
current_selection == *release
&& active_lidarr_block != ActiveLidarrBlock::ManualArtistSearchConfirmPrompt,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let size = convert_to_gb(*size);
let rejected_str = if *rejected { "" } else { "" };
+1 -1
View File
@@ -96,7 +96,7 @@ fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
artist.artist_name.scroll_left_or_reset(
get_width_from_percentage(area, 25),
*artist == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let monitored = if artist.monitored { "🏷" } else { "" };
let artist_type = artist.artist_type.clone().unwrap_or_default();
+1 -1
View File
@@ -158,7 +158,7 @@ fn draw_track_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
source_title.scroll_left_or_reset(
get_width_from_percentage(area, 40),
current_selection == *history_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
+1 -1
View File
@@ -139,7 +139,7 @@ fn draw_error(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
app
.error
.scroll_left_or_reset(area.width as usize, true, app.ui_scroll_tick_count == 0);
.scroll_left_or_reset(area.width as usize, true, app.should_text_scroll);
let paragraph = Paragraph::new(Text::from(app.error.to_string().failure()))
.block(block)
+1 -1
View File
@@ -96,7 +96,7 @@ fn draw_blocklist_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
movie.title.scroll_left_or_reset(
get_width_from_percentage(area, 20),
current_selection == *blocklist_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let languages_string = languages
@@ -90,7 +90,7 @@ pub fn draw_collection_details(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect)
movie.title.scroll_left_or_reset(
get_width_from_percentage(table_area, 20),
current_selection == *movie,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let (hours, minutes) = convert_runtime(movie.runtime);
let imdb_rating = movie
+1 -1
View File
@@ -70,7 +70,7 @@ pub(super) fn draw_collections(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect)
collection.title.scroll_left_or_reset(
get_width_from_percentage(area, 25),
*collection == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let monitored = if collection.monitored { "🏷" } else { "" };
let search_on_add = if collection.search_on_add {
+1 -1
View File
@@ -87,7 +87,7 @@ fn draw_downloads(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
output_path.as_ref().unwrap().scroll_left_or_reset(
get_width_from_percentage(area, 18),
current_selection == *download_record,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
}
+1 -1
View File
@@ -61,7 +61,7 @@ fn draw_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
source_title.scroll_left_or_reset(
get_width_from_percentage(area, 40),
current_selection == *history_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
@@ -47,7 +47,7 @@ fn draw_test_all_indexers_test_results(f: &mut Frame<'_>, app: &mut App<'_>, are
result.validation_failures.scroll_left_or_reset(
get_width_from_percentage(area, 86),
*result == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let pass_fail = if result.is_valid { "" } else { "" };
let row = Row::new(vec![
+1 -1
View File
@@ -141,7 +141,7 @@ fn draw_add_movie_search(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
movie.title.scroll_left_or_reset(
get_width_from_percentage(area, 27),
*movie == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
+1 -1
View File
@@ -90,7 +90,7 @@ fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
movie.title.scroll_left_or_reset(
get_width_from_percentage(area, 27),
*movie == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let monitored = if movie.monitored { "🏷" } else { "" };
let studio = movie.studio.clone().unwrap_or_default();
+2 -2
View File
@@ -250,7 +250,7 @@ fn draw_movie_history(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
movie_history_item.source_title.scroll_left_or_reset(
get_width_from_percentage(area, 34),
current_selection == *movie_history_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
@@ -402,7 +402,7 @@ fn draw_movie_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
get_width_from_percentage(area, 30),
current_selection == *release
&& current_route != ActiveRadarrBlock::ManualSearchConfirmPrompt.into(),
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let size = convert_to_gb(*size);
let rejected_str = if *rejected { "" } else { "" };
+1 -1
View File
@@ -88,7 +88,7 @@ fn draw_downloads(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
output_path.as_ref().unwrap().scroll_left_or_reset(
get_width_from_percentage(area, 18),
current_selection == *download_record,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
}
+1 -1
View File
@@ -61,7 +61,7 @@ fn draw_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
source_title.scroll_left_or_reset(
get_width_from_percentage(area, 40),
current_selection == *history_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
@@ -46,7 +46,7 @@ fn draw_test_all_indexers_test_results(f: &mut Frame<'_>, app: &mut App<'_>, are
result.validation_failures.scroll_left_or_reset(
get_width_from_percentage(area, 86),
*result == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let pass_fail = if result.is_valid { "" } else { "" };
let row = Row::new(vec![
+1 -1
View File
@@ -121,7 +121,7 @@ fn draw_add_series_search(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
series.title.scroll_left_or_reset(
get_width_from_percentage(area, 27),
*series == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
@@ -279,7 +279,7 @@ fn draw_episode_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect)
source_title.scroll_left_or_reset(
get_width_from_percentage(area, 40),
current_selection == *history_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
@@ -414,7 +414,7 @@ fn draw_episode_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
get_width_from_percentage(area, 30),
current_selection == *release
&& active_sonarr_block != ActiveSonarrBlock::ManualEpisodeSearchConfirmPrompt,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let size = convert_to_gb(*size);
let rejected_str = if *rejected { "" } else { "" };
+1 -1
View File
@@ -95,7 +95,7 @@ fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
series.title.scroll_left_or_reset(
get_width_from_percentage(area, 23),
*series == current_selection,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let monitored = if series.monitored { "🏷" } else { "" };
let certification = series.certification.clone().unwrap_or_default();
@@ -266,7 +266,7 @@ fn draw_season_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
source_title.scroll_left_or_reset(
get_width_from_percentage(area, 40),
current_selection == *history_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![
@@ -377,7 +377,7 @@ fn draw_season_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
get_width_from_percentage(area, 30),
current_selection == *release
&& active_sonarr_block != ActiveSonarrBlock::ManualSeasonSearchConfirmPrompt,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
let size = convert_to_gb(*size);
let rejected_str = if *rejected { "" } else { "" };
@@ -314,7 +314,7 @@ fn draw_series_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
source_title.scroll_left_or_reset(
get_width_from_percentage(area, 40),
current_selection == *history_item,
app.ui_scroll_tick_count == 0,
app.should_text_scroll,
);
Row::new(vec![