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:
117 files changed
+241
-250
No files matched your search
@@ -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()
|
||||
|
||||
@@ -28,7 +28,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;
|
||||
@@ -215,7 +215,7 @@ fn draw_author_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);
|
||||
author_description.extend(vec![
|
||||
Line::from(vec![
|
||||
"Books: ".primary().bold(),
|
||||
@@ -227,7 +227,7 @@ fn draw_author_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(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
@@ -278,13 +278,10 @@ fn draw_books_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
|| "N/A".to_owned(),
|
||||
|s| format!("{}/{}", s.book_file_count, s.total_book_count),
|
||||
);
|
||||
let size = book.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 = book
|
||||
.statistics
|
||||
.as_ref()
|
||||
.map_or_else(|| "N/A".to_owned(), |s| format_size(s.size_on_disk, 2));
|
||||
|
||||
decorate_book_row_with_style(
|
||||
book,
|
||||
@@ -483,7 +480,7 @@ fn draw_author_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
&& active_readarr_block != ActiveReadarrBlock::ManualAuthorSearchConfirmPrompt,
|
||||
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("")
|
||||
@@ -514,7 +511,7 @@ fn draw_author_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),
|
||||
])
|
||||
|
||||
@@ -14,7 +14,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};
|
||||
@@ -234,7 +234,7 @@ fn draw_book_file_info(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
..
|
||||
} = book_file;
|
||||
|
||||
let size = convert_to_gb(*size);
|
||||
let size = format_size(*size, 2);
|
||||
let audio_info = media_info
|
||||
.as_ref()
|
||||
.map(|media_info| {
|
||||
@@ -249,7 +249,7 @@ fn draw_book_file_info(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
|
||||
Row::new(vec![
|
||||
Cell::from(path.clone()),
|
||||
Cell::from(format!("{size:.2} GB")),
|
||||
Cell::from(size),
|
||||
Cell::from(quality.quality.name.clone()),
|
||||
Cell::from(audio_info),
|
||||
])
|
||||
@@ -395,7 +395,7 @@ fn draw_book_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
&& active_readarr_block != ActiveReadarrBlock::ManualBookSearchConfirmPrompt,
|
||||
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("")
|
||||
@@ -426,7 +426,7 @@ fn draw_book_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),
|
||||
])
|
||||
|
||||
@@ -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::{
|
||||
@@ -103,7 +103,7 @@ fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
let size = author
|
||||
.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(&author.quality_profile_id)
|
||||
.cloned()
|
||||
@@ -134,7 +134,7 @@ fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
Cell::from(quality_profile),
|
||||
Cell::from(metadata_profile),
|
||||
Cell::from(books.to_string()),
|
||||
Cell::from(format!("{size:.2} GB")),
|
||||
Cell::from(format_size(size, 2)),
|
||||
Cell::from(monitored.to_owned()),
|
||||
Cell::from(tags),
|
||||
]),
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ expression: output
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Files Release Date Size ││
|
||||
││=> 🏷 Test Book 3/7 2023-05-20 2.30 GB ││
|
||||
││=> 🏷 Test Book 3/7 2023-05-20 2.34 MB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ expression: output
|
||||
││ Books │ History │ Author Search │Do you want to trigger an automatic search of your indexers│ ││
|
||||
││─────────────────────────────────────────│ for all monitored book(s) for the author: Test Author? │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │Date Size ││
|
||||
││=> 🏷 Test Book │ │20 2.30 GB ││
|
||||
││=> 🏷 Test Book │ │20 2.34 MB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ expression: output
|
||||
││ Books │ History │ Author Search │Do you want to trigger an automatic search of your indexers│ ││
|
||||
││─────────────────────────────────────────│ for all monitored book(s) for the author: Test Author? │───────────────────────────────────────────││
|
||||
││ Source ▼ Age ⛔ Title │ │ Size Peers Quality ││
|
||||
││=> torrent 1 days ⛔ Test Torren│ │ 0.0 GB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet│ │ 0.0 GB EPUB ││
|
||||
││=> torrent 1 days ⛔ Test Torren│ │ 0.0 MB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet│ │ 0.0 MB EPUB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ expression: output
|
||||
││ Books │ History │ Author Search │ Torrent Release? │ ││
|
||||
││────────────────────────────────────────│ │───────────────────────────────────────││
|
||||
││ Source ▼ Age ⛔ Title │ │e Peers Quality ││
|
||||
││=> torrent 1 days ⛔ Test Torre│Rejection reasons: │ GB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usene│• Unknown quality profile │ GB EPUB ││
|
||||
││=> torrent 1 days ⛔ Test Torre│Rejection reasons: │ MB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usene│• Unknown quality profile │ MB EPUB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ expression: output
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Age ⛔ Title Indexer Size Peers Quality ││
|
||||
││=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 GB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 GB EPUB ││
|
||||
││=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 MB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 MB EPUB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ expression: output
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source ▼ Age ⛔ Title Indexer Size Peers Quality ││
|
||||
││=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 GB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 GB EPUB ││
|
||||
││=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 MB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 MB EPUB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ expression: output
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Files Release Date Size ││
|
||||
││=> 🏷 Test Book 3/7 2023-05-20 2.30 GB ││
|
||||
││=> 🏷 Test Book 3/7 2023-05-20 2.34 MB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ expression: output
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Files Release Date Size ││
|
||||
││=> 🏷 Test Book 3/7 2023-05-20 2.30 GB ││
|
||||
││=> 🏷 Test Book 3/7 2023-05-20 2.34 MB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ expression: output
|
||||
││ Books │ History │ Author Search │ Do you want to trigger an update and disk scan for the │ ││
|
||||
││─────────────────────────────────────────│ author: Test Author? │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │Date Size ││
|
||||
││=> 🏷 Test Book │ │20 2.30 GB ││
|
||||
││=> 🏷 Test Book │ │20 2.34 MB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ expression: output
|
||||
││ Books │ History │ Author Search │ Do you want to trigger an update and disk scan for the │ ││
|
||||
││─────────────────────────────────────────│ author: Test Author? │───────────────────────────────────────────││
|
||||
││ Source ▼ Age ⛔ Title │ │ Size Peers Quality ││
|
||||
││=> torrent 1 days ⛔ Test Torren│ │ 0.0 GB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet│ │ 0.0 GB EPUB ││
|
||||
││=> torrent 1 days ⛔ Test Torren│ │ 0.0 MB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet│ │ 0.0 MB EPUB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ expression: output
|
||||
││ Books │ History │ Author Search │Do you want to trigger an automatic search of your indexers│ ││
|
||||
││─────────────────────────────────────────│ for all monitored book(s) for the author: Test Author? │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │Date Size ││
|
||||
││=> 🏷 Test Book │ │20 2.30 GB ││
|
||||
││=> 🏷 Test Book │ │20 2.34 MB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ expression: output
|
||||
││ Books │ History │ Author Search │ Do you really want to delete the book: │ ││
|
||||
││─────────────────────────────────────────│ Test Book? │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │Date Size ││
|
||||
││=> 🏷 Test Book │ │20 2.30 GB ││
|
||||
││=> 🏷 Test Book │ │20 2.34 MB ││
|
||||
││ │ ╭───╮ │ ││
|
||||
││ │ Delete Book Files: │ ✔ │ │ ││
|
||||
││ │ ╰───╯ │ ││
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ expression: output
|
||||
││ Books │ History │ Author Search │ Do you want to trigger an update and disk scan for the │ ││
|
||||
││─────────────────────────────────────────│ author: Test Author? │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │Date Size ││
|
||||
││=> 🏷 Test Book │ │20 2.30 GB ││
|
||||
││=> 🏷 Test Book │ │20 2.34 MB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ expression: output
|
||||
│ Editions │ History │ File │ Manual Search │
|
||||
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Path Size Quality Media Info │
|
||||
│=> /nfs/books/Test Author/Test Book.epub 3.30 GB EPUB MP3 - 2.0 - 128 kbps - 44100 - 16 │
|
||||
│=> /nfs/books/Test Author/Test Book.epub 3.20 MB EPUB MP3 - 2.0 - 128 kbps - 44100 - 16 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ expression: output
|
||||
│ Editions │ History │ File │ Manual Search │
|
||||
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Source ▼ Age ⛔ Title Indexer Size Peers Quality │
|
||||
│=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 GB 2 / 1 EPUB │
|
||||
│ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 GB EPUB │
|
||||
│=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 MB 2 / 1 EPUB │
|
||||
│ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 MB EPUB │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ expression: output
|
||||
│ Editions │ History │ File │ Manual Search │
|
||||
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Path Size Quality Media Info │
|
||||
│=> /nfs/books/Test Author/Test Book.epub 3.30 GB EPUB MP3 - 2.0 - 128 kbps - 44100 - 16 │
|
||||
│=> /nfs/books/Test Author/Test Book.epub 3.20 MB EPUB MP3 - 2.0 - 128 kbps - 44100 - 16 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ expression: output
|
||||
│ Editions │ History │ File │ Manual Search │
|
||||
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Path Size Quality Media Info │
|
||||
│=> /nfs/books/Test Author/Test Book.epub 3.30 GB EPUB MP3 - 2.0 - 128 kbps - 44100 - 16 │
|
||||
│=> /nfs/books/Test Author/Test Book.epub 3.20 MB EPUB MP3 - 2.0 - 128 kbps - 44100 - 16 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ expression: output
|
||||
│ Editions │ History │ File │ Manual Search │
|
||||
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Source ▼ Age ⛔ Title Indexer Size Peers Quality │
|
||||
│=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 GB 2 / 1 EPUB │
|
||||
│ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 GB EPUB │
|
||||
│=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 MB 2 / 1 EPUB │
|
||||
│ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 MB EPUB │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ expression: output
|
||||
│ Editions │ History │ File │ Manual Search │
|
||||
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Source Age ⛔ Title Indexer Size Peers Quality │
|
||||
│=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 GB 2 / 1 EPUB │
|
||||
│ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 GB EPUB │
|
||||
│=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 MB 2 / 1 EPUB │
|
||||
│ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 MB EPUB │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ expression: output
|
||||
│ Editions │ History │ File │ Manual Search │
|
||||
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Source ▼ Age ⛔ Title Indexer Size Peers Quality │
|
||||
│=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 GB 2 / 1 EPUB │
|
||||
│ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 GB EPUB │
|
||||
│=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 MB 2 / 1 EPUB │
|
||||
│ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 MB EPUB │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Status: Continuing │
|
||||
@@ -22,7 +22,7 @@ expression: output
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Files Release Date Size ││
|
||||
││=> 🏷 Test Book 3/7 2023-05-20 2.30 GB ││
|
||||
││=> 🏷 Test Book 3/7 2023-05-20 2.34 MB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
+1
-1
@@ -4,7 +4,7 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex
|
||||
=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use crate::{
|
||||
servarr_data::readarr::readarr_data::ReadarrData,
|
||||
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();
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ expression: output
|
||||
│ Library │ Downloads │ Blocklist │ History │ Root Folders │ Indexers │ System │
|
||||
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags │
|
||||
│=> Test Author Continuing Standard Comprehensive 0 0.00 GB 🏷 alex │
|
||||
│=> Test Author Continuing Standard Comprehensive 0 0.00 MB 🏷 alex │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
Reference in new issue
Block a user