feat: show sizes under a gigabyte in megabytes

Every size cell converted bytes to gigabytes and formatted the float in
place, so anything below a gigabyte rendered as 0.00 GB. Books and
tracks are almost always that small, which made the Size columns in
Readarr and Lidarr useless.

Replace convert_to_gb and convert_f64_to_gb with one format_size helper
that renders gigabytes at or above 1 GiB and megabytes below it, at the
precision each site already used. Every render site across the four
servarr trees now calls it, including the two movie and episode detail
strings built on the network side. Values at or above a gigabyte render
byte for byte as before.

Give the Readarr book statistics and book file fixtures and the Lidarr
album statistics fixture realistic sub-gigabyte sizes so the megabyte
path is pinned by the committed snapshots.
This commit is contained in:
Dark-Alex-17 committed 2026-09-18 21:44:22 -06:00
1 parent bdeaf6ae35
commit f2ee1e71f6
117 files changed
+241 -250

No files matched your search

+3 -3
View File
@@ -12,7 +12,7 @@ use crate::ui::utils::{get_width_from_percentage, layout_block_top_border};
use crate::ui::widgets::confirmation_prompt::ConfirmationPrompt;
use crate::ui::widgets::managarr_table::ManagarrTable;
use crate::ui::widgets::popup::{Popup, Size};
use crate::utils::convert_f64_to_gb;
use crate::utils::format_size;
#[cfg(test)]
#[path = "downloads_ui_tests.rs"]
@@ -97,12 +97,12 @@ fn draw_downloads(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
} else {
1f64 - (*sizeleft / *size)
};
let file_size: f64 = convert_f64_to_gb(*size);
let file_size = format_size(*size as i64, 2);
Row::new(vec![
Cell::from(title.to_owned()),
Cell::from(format!("{:.0}%", percent * 100.0)),
Cell::from(format!("{file_size:.2} GB")),
Cell::from(file_size),
Cell::from(
output_path
.as_ref()
+3 -3
View File
@@ -15,7 +15,7 @@ use crate::ui::widgets::managarr_table::ManagarrTable;
use crate::ui::widgets::message::Message;
use crate::ui::widgets::popup::{Popup, Size};
use crate::ui::{DrawUi, draw_popup, draw_tabs};
use crate::utils::convert_to_gb;
use crate::utils::format_size;
use ratatui::Frame;
use ratatui::layout::{Alignment, Constraint, Rect};
use ratatui::prelude::{Line, Stylize, Text};
@@ -377,7 +377,7 @@ fn draw_album_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
&& active_lidarr_block != ActiveLidarrBlock::ManualAlbumSearchConfirmPrompt,
app.should_text_scroll,
);
let size = convert_to_gb(*size);
let size = format_size(*size, 1);
let rejected_str = if *rejected { "⛔" } else { "" };
let peers = if seeders.is_none() || leechers.is_none() {
Text::from("")
@@ -408,7 +408,7 @@ fn draw_album_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
Cell::from(rejected_str),
Cell::from(title.to_string()),
Cell::from(indexer.clone()),
Cell::from(format!("{size:.1} GB")),
Cell::from(size),
Cell::from(peers),
Cell::from(quality_name),
])
+9 -12
View File
@@ -26,7 +26,7 @@ use crate::ui::widgets::managarr_table::ManagarrTable;
use crate::ui::widgets::message::Message;
use crate::ui::widgets::popup::{Popup, Size};
use crate::ui::{DrawUi, draw_popup, draw_tabs};
use crate::utils::convert_to_gb;
use crate::utils::format_size;
use ratatui::layout::Alignment;
use ratatui::text::Text;
use serde_json::Number;
@@ -223,7 +223,7 @@ fn draw_artist_description(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
];
if let Some(stats) = current_selection.statistics.as_ref() {
let size = convert_to_gb(stats.size_on_disk);
let size = format_size(stats.size_on_disk, 2);
artist_description.extend(vec![
Line::from(vec![
"Albums: ".primary().bold(),
@@ -235,7 +235,7 @@ fn draw_artist_description(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
]),
Line::from(vec![
"Size on Disk: ".primary().bold(),
format!("{size:.2} GB").default_color(),
size.default_color(),
]),
]);
}
@@ -282,13 +282,10 @@ fn draw_albums_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|| "N/A".to_owned(),
|s| format!("{}/{}", s.track_file_count, s.total_track_count),
);
let size = album.statistics.as_ref().map_or_else(
|| "N/A".to_owned(),
|s| {
let size = convert_to_gb(s.size_on_disk);
format!("{size:.2} GB")
},
);
let size = album
.statistics
.as_ref()
.map_or_else(|| "N/A".to_owned(), |s| format_size(s.size_on_disk, 2));
let duration_mins = album.duration / 60000;
decorate_album_row_with_style(
@@ -500,7 +497,7 @@ fn draw_artist_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
&& active_lidarr_block != ActiveLidarrBlock::ManualArtistSearchConfirmPrompt,
app.should_text_scroll,
);
let size = convert_to_gb(*size);
let size = format_size(*size, 1);
let rejected_str = if *rejected { "⛔" } else { "" };
let peers = if seeders.is_none() || leechers.is_none() {
Text::from("")
@@ -531,7 +528,7 @@ fn draw_artist_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
Cell::from(rejected_str),
Cell::from(title.to_string()),
Cell::from(indexer.clone()),
Cell::from(format!("{size:.1} GB")),
Cell::from(size),
Cell::from(peers),
Cell::from(quality_name),
])
+3 -3
View File
@@ -13,7 +13,7 @@ use crate::ui::widgets::{
confirmation_prompt::ConfirmationPrompt,
popup::{Popup, Size},
};
use crate::utils::convert_to_gb;
use crate::utils::format_size;
use crate::{
app::App,
models::{
@@ -104,7 +104,7 @@ fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
let size = artist
.statistics
.as_ref()
.map_or(0f64, |stats| convert_to_gb(stats.size_on_disk));
.map_or(0, |stats| stats.size_on_disk);
let quality_profile = quality_profile_map
.get_by_left(&artist.quality_profile_id)
.cloned()
@@ -140,7 +140,7 @@ fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
Cell::from(metadata_profile),
Cell::from(albums.to_string()),
Cell::from(tracks),
Cell::from(format!("{size:.2} GB")),
Cell::from(format_size(size, 2)),
Cell::from(monitored.to_owned()),
Cell::from(tags),
]),
@@ -10,8 +10,8 @@ expression: output
│ Tracks │ History │ Manual Search │
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ Source ▼ Age ⛔ Title Indexer Size Peers Quality │
│=> torrent 1 days ⛔ Test Release kickass torrents 0.0 GB 2 / 1 Lossless │
│ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 GB Lossless │
│=> torrent 1 days ⛔ Test Release kickass torrents 0.0 MB 2 / 1 Lossless │
│ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 MB Lossless │
│ │
│ │
│ │
@@ -10,8 +10,8 @@ expression: output
│ Tracks │ History │ Manual Search │
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ Source ▼ Age ⛔ Title Indexer Size Peers Quality │
│=> torrent 1 days ⛔ Test Release kickass torrents 0.0 GB 2 / 1 Lossless │
│ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 GB Lossless │
│=> torrent 1 days ⛔ Test Release kickass torrents 0.0 MB 2 / 1 Lossless │
│ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 MB Lossless │
│ │
│ │
│ │
@@ -10,8 +10,8 @@ expression: output
│ Tracks │ History │ Manual Search │
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ Source Age ⛔ Title Indexer Size Peers Quality │
│=> torrent 1 days ⛔ Test Release kickass torrents 0.0 GB 2 / 1 Lossless │
│ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 GB Lossless │
│=> torrent 1 days ⛔ Test Release kickass torrents 0.0 MB 2 / 1 Lossless │
│ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 MB Lossless │
│ │
│ │
│ │
@@ -10,8 +10,8 @@ expression: output
│ Tracks │ History │ Manual Search │
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ Source ▼ Age ⛔ Title Indexer Size Peers Quality │
│=> torrent 1 days ⛔ Test Release kickass torrents 0.0 GB 2 / 1 Lossless │
│ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 GB Lossless │
│=> torrent 1 days ⛔ Test Release kickass torrents 0.0 MB 2 / 1 Lossless │
│ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 MB Lossless │
│ │
│ │
│ │
@@ -24,7 +24,7 @@ expression: output
││ Albums │ History │ Manual Search ││
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
││ Monitored Title Type Tracks Duration Release Date Size ││
││=> 🏷 Test Album Album 8/10 0 min 2023-01-01 0.00 GB ││
││=> 🏷 Test Album Album 8/10 0 min 2023-01-01 302.47 MB ││
││ ││
││ ││
││ ││
@@ -24,7 +24,7 @@ expression: output
││ Albums │ History │ Manual Search │ │ ││
││─────────────────────────────────────────│ │───────────────────────────────────────────││
││ Monitored Title │ │ Release Date Size ││
││=> 🏷 Test Album │ │ 2023-01-01 0.00 GB ││
││=> 🏷 Test Album │ │ 2023-01-01 302.47 MB ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -24,8 +24,8 @@ expression: output
││ Albums │ History │ Manual Search │ │ ││
││─────────────────────────────────────────│ │───────────────────────────────────────────││
││ Source ▼ Age ⛔ Title │ │ Size Peers Quality ││
││=> torrent 1 days ⛔ Test Releas│ │ 0.0 GB 2 / 1 Lossless ││
││ usenet 1 days ⛔ Test Releas│ │ 0.0 GB Lossless ││
││=> torrent 1 days ⛔ Test Releas│ │ 0.0 MB 2 / 1 Lossless ││
││ usenet 1 days ⛔ Test Releas│ │ 0.0 MB Lossless ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -24,8 +24,8 @@ expression: output
││ Albums │ History │ Manual Search │ │ ││
││────────────────────────────────────────│Rejection reasons: │───────────────────────────────────────││
││ Source ▼ Age ⛔ Title │• Unknown quality profile │e Peers Quality ││
││=> torrent 1 days ⛔ Test Relea│• Release is already mapped │ GB 2 / 1 Lossless ││
││ usenet 1 days ⛔ Test Relea│ │ GB Lossless ││
││=> torrent 1 days ⛔ Test Relea│• Release is already mapped │ MB 2 / 1 Lossless ││
││ usenet 1 days ⛔ Test Relea│ │ MB Lossless ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -24,8 +24,8 @@ expression: output
││ Albums │ History │ Manual Search ││
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
││ Source Age ⛔ Title Indexer Size Peers Quality ││
││=> torrent 1 days ⛔ Test Release kickass torrents 0.0 GB 2 / 1 Lossless ││
││ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 GB Lossless ││
││=> torrent 1 days ⛔ Test Release kickass torrents 0.0 MB 2 / 1 Lossless ││
││ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 MB Lossless ││
││ ││
││ ││
││ ││
@@ -24,8 +24,8 @@ expression: output
││ Albums │ History │ Manual Search ││
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
││ Source ▼ Age ⛔ Title Indexer Size Peers Quality ││
││=> torrent 1 days ⛔ Test Release kickass torrents 0.0 GB 2 / 1 Lossless ││
││ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 GB Lossless ││
││=> torrent 1 days ⛔ Test Release kickass torrents 0.0 MB 2 / 1 Lossless ││
││ usenet 1 days ⛔ Test Release DrunkenSlug 0.0 MB Lossless ││
││ ││
││ ││
││ ││
@@ -24,7 +24,7 @@ expression: output
││ Albums │ History │ Manual Search ││
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
││ Monitored Title Type Tracks Duration Release Date Size ││
││=> 🏷 Test Album Album 8/10 0 min 2023-01-01 0.00 GB ││
││=> 🏷 Test Album Album 8/10 0 min 2023-01-01 302.47 MB ││
││ ││
││ ││
││ ││
@@ -24,7 +24,7 @@ expression: output
││ Albums │ History │ Manual Search ││
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
││ Monitored Title Type Tracks Duration Release Date Size ││
││=> 🏷 Test Album Album 8/10 0 min 2023-01-01 0.00 GB ││
││=> 🏷 Test Album Album 8/10 0 min 2023-01-01 302.47 MB ││
││ ││
││ ││
││ ││
@@ -24,7 +24,7 @@ expression: output
││ Albums │ History │ Manual Search │ │ ││
││─────────────────────────────────────────│ │───────────────────────────────────────────││
││ Monitored Title │ │ Release Date Size ││
││=> 🏷 Test Album │ │ 2023-01-01 0.00 GB ││
││=> 🏷 Test Album │ │ 2023-01-01 302.47 MB ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -24,8 +24,8 @@ expression: output
││ Albums │ History │ Manual Search │ │ ││
││─────────────────────────────────────────│ │───────────────────────────────────────────││
││ Source ▼ Age ⛔ Title │ │ Size Peers Quality ││
││=> torrent 1 days ⛔ Test Releas│ │ 0.0 GB 2 / 1 Lossless ││
││ usenet 1 days ⛔ Test Releas│ │ 0.0 GB Lossless ││
││=> torrent 1 days ⛔ Test Releas│ │ 0.0 MB 2 / 1 Lossless ││
││ usenet 1 days ⛔ Test Releas│ │ 0.0 MB Lossless ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -24,7 +24,7 @@ expression: output
││ Albums │ History │ Manual Search │ │ ││
││─────────────────────────────────────────│ │───────────────────────────────────────────││
││ Monitored Title │ │ Release Date Size ││
││=> 🏷 Test Album │ │ 2023-01-01 0.00 GB ││
││=> 🏷 Test Album │ │ 2023-01-01 302.47 MB ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -24,7 +24,7 @@ expression: output
││ Albums │ History │ Manual Search │ │ ││
││─────────────────────────────────────────│ │───────────────────────────────────────────││
││ Monitored Title │ ╭───╮ │ Release Date Size ││
││=> 🏷 Test Album │ Delete Album Files: │ ✔ │ │ 2023-01-01 0.00 GB ││
││=> 🏷 Test Album │ Delete Album Files: │ ✔ │ │ 2023-01-01 302.47 MB ││
││ │ ╰───╯ │ ││
││ │ ╭───╮ │ ││
││ │ Add List Exclusion: │ │ │ ││
@@ -24,7 +24,7 @@ expression: output
││ Albums │ History │ Manual Search │ │ ││
││─────────────────────────────────────────│ │───────────────────────────────────────────││
││ Monitored Title │ │ Release Date Size ││
││=> 🏷 Test Album │ │ 2023-01-01 0.00 GB ││
││=> 🏷 Test Album │ │ 2023-01-01 302.47 MB ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│Artist: Alex │
│Overview: some interesting description of the artist She was born in Madison, Wisconsin: a city she has never really left. Her first album took her│
@@ -24,7 +24,7 @@ expression: output
││ Albums │ History │ Monitor New Albums: │All Albums ▼ │ │ ││
││──────────────────│ ╰─────────────────────────────────────────────────╯ │────────────────────││
││ Monitored Titl│ ╭─────────────────────────────────────────────────╮ │ize ││
││=> 🏷 Test│ Quality Profile: │Lossless ▼ │ │.00 GB ││
││=> 🏷 Test│ Quality Profile: │Lossless ▼ │ │02.47 MB ││
││ │ ╰─────────────────────────────────────────────────╯ │ ││
││ │ ╭─────────────────────────────────────────────────╮ │ ││
││ │ Metadata Profile: │Standard ▼ │ │ ││
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│Artist: Alex │
│Overview: some interesting description of the artist She was born in Madison, Wisconsin: a city she has never really left. Her first album took her│
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│Artist: Alex │
│Overview: some interesting description of the artist She was born in Madison, Wisconsin: a city she has never really left. Her first album took her│
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│Artist: Alex │
│Overview: some interesting description of the artist She was born in Madison, Wisconsin: a city she has never really left. Her first album took her│
@@ -24,7 +24,7 @@ expression: output
││ Albums │ History │ Manual Search ││
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
││ Monitored Title Type Tracks Duration Release Date Size ││
││=> 🏷 Test Album Album 8/10 0 min 2023-01-01 0.00 GB ││
││=> 🏷 Test Album Album 8/10 0 min 2023-01-01 302.47 MB ││
││ ││
││ ││
││ ││
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
@@ -4,4 +4,4 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
@@ -4,7 +4,7 @@ expression: output
---
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags
=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex
=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex
+3 -3
View File
@@ -37,7 +37,7 @@ use crate::{
servarr_data::lidarr::lidarr_data::LidarrData,
servarr_models::{DiskSpace, RootFolder},
},
utils::convert_to_gb,
utils::format_size,
};
mod blocklist;
@@ -176,8 +176,8 @@ fn draw_stats_context(f: &mut Frame<'_>, app: &App<'_>, area: Rect) {
let RootFolder {
path, free_space, ..
} = &monitored_root_folders[i];
let space: f64 = convert_to_gb(*free_space);
let root_folder_space = Paragraph::new(format!("{path}: {space:.2} GB free"))
let space = format_size(*free_space, 2);
let root_folder_space = Paragraph::new(format!("{path}: {space} free"))
.block(borderless_block())
.default_color();
+3 -3
View File
@@ -15,7 +15,7 @@ use crate::ui::utils::layout_block_top_border;
use crate::ui::widgets::confirmation_prompt::ConfirmationPrompt;
use crate::ui::widgets::managarr_table::ManagarrTable;
use crate::ui::widgets::popup::{Popup, Size};
use crate::utils::convert_to_gb;
use crate::utils::format_size;
mod add_root_folder_ui;
@@ -69,11 +69,11 @@ fn draw_root_folders(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
..
} = root_folders;
let space: f64 = convert_to_gb(*free_space);
let space = format_size(*free_space, 2);
Row::new(vec![
Cell::from(path.to_owned()),
Cell::from(format!("{space:.2} GB")),
Cell::from(space),
Cell::from(
unmapped_folders
.as_ref()
@@ -6,7 +6,7 @@ expression: output
│ Library │ Downloads │ Blocklist │ History │ Root Folders │ Indexers │ System │
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags │
│=> Alex Person Continuing Lossless Standard 1 12/15 0.00 GB 🏷 alex │
│=> Alex Person Continuing Lossless Standard 1 12/15 0.01 MB 🏷 alex │
│ │
│ │
│ │