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
@@ -295,7 +295,7 @@ impl ReadarrData<'_> {
|
||||
statistics: Some(BookStatistics {
|
||||
book_file_count: 3,
|
||||
total_book_count: 7,
|
||||
size_on_disk: 2469606195,
|
||||
size_on_disk: 2457600,
|
||||
percent_of_books: 42.86,
|
||||
}),
|
||||
..Book::default()
|
||||
@@ -538,7 +538,7 @@ impl ReadarrData<'_> {
|
||||
author_id: 1,
|
||||
book_id: 1,
|
||||
path: "/nfs/books/Test Author/Test Book.epub".to_owned(),
|
||||
size: 3543348019,
|
||||
size: 3355443,
|
||||
date_added: date,
|
||||
quality: quality.clone(),
|
||||
media_info: Some(MediaInfo {
|
||||
|
||||
@@ -34,7 +34,7 @@ mod tests {
|
||||
"trackFileCount": 8,
|
||||
"trackCount": 10,
|
||||
"totalTrackCount": 10,
|
||||
"sizeOnDisk": 1024,
|
||||
"sizeOnDisk": 317162578,
|
||||
"percentOfTracks": 99.9
|
||||
}
|
||||
}]);
|
||||
|
||||
@@ -74,7 +74,7 @@ pub mod test_utils {
|
||||
"trackFileCount": 8,
|
||||
"trackCount": 10,
|
||||
"totalTrackCount": 10,
|
||||
"sizeOnDisk": 1024,
|
||||
"sizeOnDisk": 317162578,
|
||||
"percentOfTracks": 99.9
|
||||
}
|
||||
}"#;
|
||||
@@ -250,7 +250,7 @@ pub mod test_utils {
|
||||
track_file_count: 8,
|
||||
track_count: 10,
|
||||
total_track_count: 10,
|
||||
size_on_disk: 1024,
|
||||
size_on_disk: 317162578,
|
||||
percent_of_tracks: 99.9,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ use crate::models::stateful_table::StatefulTable;
|
||||
use crate::models::{Route, ScrollableText};
|
||||
use crate::network::radarr_network::RadarrEvent;
|
||||
use crate::network::{Network, RequestMethod};
|
||||
use crate::utils::{convert_runtime, convert_to_gb};
|
||||
use crate::utils::{convert_runtime, format_size};
|
||||
use anyhow::Result;
|
||||
use indoc::formatdoc;
|
||||
use log::{debug, info, warn};
|
||||
@@ -319,7 +319,7 @@ impl Network<'_, '_> {
|
||||
..
|
||||
} = movie_response;
|
||||
let (hours, minutes) = convert_runtime(runtime);
|
||||
let size = convert_to_gb(size_on_disk);
|
||||
let size = format_size(size_on_disk, 2);
|
||||
let studio = studio.clone().unwrap_or_default();
|
||||
let quality_profile = app
|
||||
.data
|
||||
@@ -374,7 +374,7 @@ impl Network<'_, '_> {
|
||||
IMDB: {imdb_rating}
|
||||
Rotten Tomatoes: {rotten_tomatoes_rating}
|
||||
Quality Profile: {quality_profile}
|
||||
Size: {size:.2} GB
|
||||
Size: {size}
|
||||
Path: {path}
|
||||
Studio: {studio}
|
||||
Genres: {}",
|
||||
@@ -393,7 +393,7 @@ impl Network<'_, '_> {
|
||||
movie_details_modal.file_details = formatdoc!(
|
||||
"Relative Path: {}
|
||||
Absolute Path: {}
|
||||
Size: {size:.2} GB
|
||||
Size: {size}
|
||||
Date Added: {}",
|
||||
file.relative_path,
|
||||
file.path,
|
||||
|
||||
@@ -759,7 +759,7 @@ mod tests {
|
||||
IMDB:
|
||||
Rotten Tomatoes:
|
||||
Quality Profile: HD - 1080p
|
||||
Size: 0.00 GB
|
||||
Size: 0.00 MB
|
||||
Path: /nfs/movies
|
||||
Studio: 21st Century Alex
|
||||
Genres: cool, family, fun"
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::models::sonarr_models::{
|
||||
use crate::models::{Route, ScrollableText};
|
||||
use crate::network::sonarr_network::SonarrEvent;
|
||||
use crate::network::{Network, RequestMethod};
|
||||
use crate::utils::convert_to_gb;
|
||||
use crate::utils::format_size;
|
||||
use anyhow::Result;
|
||||
use indoc::formatdoc;
|
||||
use log::info;
|
||||
@@ -222,12 +222,12 @@ impl Network<'_, '_> {
|
||||
overview.unwrap_or_default(),
|
||||
));
|
||||
if let Some(file) = episode_file {
|
||||
let size = convert_to_gb(file.size);
|
||||
let size = format_size(file.size, 2);
|
||||
episode_details_modal.file_details = formatdoc!(
|
||||
"
|
||||
Relative Path: {}
|
||||
Absolute Path: {}
|
||||
Size: {size:.2} GB
|
||||
Size: {size}
|
||||
Language: {}
|
||||
Date Added: {}",
|
||||
file.relative_path,
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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),
|
||||
])
|
||||
|
||||
@@ -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),
|
||||
])
|
||||
|
||||
@@ -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),
|
||||
]),
|
||||
|
||||
+2
-2
@@ -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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -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 ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+1
-1
@@ -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 ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+2
-2
@@ -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 ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+2
-2
@@ -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 ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+2
-2
@@ -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 ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+2
-2
@@ -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 ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+1
-1
@@ -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 ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+1
-1
@@ -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 ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+1
-1
@@ -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 ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+2
-2
@@ -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 ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+1
-1
@@ -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 ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+1
-1
@@ -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: │ │ │ ││
|
||||
|
||||
+1
-1
@@ -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 ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+2
-2
@@ -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 ▼ │ │ ││
|
||||
|
||||
+1
-1
@@ -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│
|
||||
|
||||
+1
-1
@@ -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│
|
||||
|
||||
+2
-2
@@ -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 ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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 ▼ 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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
@@ -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_to_gb;
|
||||
use crate::utils::format_size;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "downloads_ui_tests.rs"]
|
||||
@@ -96,12 +96,12 @@ fn draw_downloads(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
} else {
|
||||
1f64 - (*sizeleft as f64 / *size as f64)
|
||||
};
|
||||
let file_size: f64 = convert_to_gb(*size);
|
||||
let file_size = format_size(*size, 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()
|
||||
|
||||
@@ -16,7 +16,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_runtime, convert_to_gb};
|
||||
use crate::utils::{convert_runtime, format_size};
|
||||
|
||||
mod add_movie_ui;
|
||||
mod delete_movie_ui;
|
||||
@@ -95,7 +95,7 @@ fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
let monitored = if movie.monitored { "🏷" } else { "" };
|
||||
let studio = movie.studio.clone().unwrap_or_default();
|
||||
let (hours, minutes) = convert_runtime(movie.runtime);
|
||||
let file_size: f64 = convert_to_gb(movie.size_on_disk);
|
||||
let file_size = format_size(movie.size_on_disk, 2);
|
||||
let certification = movie.certification.clone().unwrap_or_default();
|
||||
let quality_profile = quality_profile_map
|
||||
.get_by_left(&movie.quality_profile_id)
|
||||
@@ -121,7 +121,7 @@ fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
Cell::from(format!("{hours}h {minutes}m")),
|
||||
Cell::from(certification),
|
||||
Cell::from(movie.original_language.name.to_owned()),
|
||||
Cell::from(format!("{file_size:.2} GB")),
|
||||
Cell::from(file_size),
|
||||
Cell::from(quality_profile),
|
||||
Cell::from(monitored.to_owned()),
|
||||
Cell::from(tags),
|
||||
|
||||
@@ -26,7 +26,7 @@ use crate::ui::widgets::loading_block::LoadingBlock;
|
||||
use crate::ui::widgets::managarr_table::ManagarrTable;
|
||||
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;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "movie_details_ui_tests.rs"]
|
||||
@@ -398,7 +398,7 @@ fn draw_movie_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
&& current_route != ActiveRadarrBlock::ManualSearchConfirmPrompt.into(),
|
||||
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("")
|
||||
@@ -434,7 +434,7 @@ fn draw_movie_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(language),
|
||||
Cell::from(quality),
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ expression: output
|
||||
│ Details │ History │ File │ Cast │ Crew │ Manual Search │
|
||||
│──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Source ▼ Age ⛔ Title Indexer Size Peers Language Quality │
|
||||
│=> torrent 12 days ⛔ Some movie release The Pirate Bay 0.0 GB 25 / 3 English HD - 1080p │
|
||||
│ usenet 22 days ⛔ Some Other movie rele The Pirate Bay 0.0 GB English HD - 1080p │
|
||||
│=> torrent 12 days ⛔ Some movie release The Pirate Bay 0.0 MB 25 / 3 English HD - 1080p │
|
||||
│ usenet 22 days ⛔ Some Other movie rele The Pirate Bay 0.0 MB English HD - 1080p │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ expression: output
|
||||
│ Details │ History │ File │ Cast │ Crew │ Manual Search │
|
||||
│──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Source ▼ Age ⛔ Title Indexer Size Peers Language Quality │
|
||||
│=> torrent 12 days ⛔ Some movie release The Pirate Bay 0.0 GB 25 / 3 English HD - 1080p │
|
||||
│ usenet 22 days ⛔ Some Other movie rele The Pirate Bay 0.0 GB English HD - 1080p │
|
||||
│=> torrent 12 days ⛔ Some movie release The Pirate Bay 0.0 MB 25 / 3 English HD - 1080p │
|
||||
│ usenet 22 days ⛔ Some Other movie rele The Pirate Bay 0.0 MB English HD - 1080p │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ expression: output
|
||||
│ Details │ History │ File │ Cast │ Crew │ Manual Search │
|
||||
│──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Source Age ⛔ Title Indexer Size Peers Language Quality │
|
||||
│=> torrent 12 days ⛔ Some movie release The Pirate Bay 0.0 GB 25 / 3 English HD - 1080p │
|
||||
│ usenet 22 days ⛔ Some Other movie rele The Pirate Bay 0.0 GB English HD - 1080p │
|
||||
│=> torrent 12 days ⛔ Some movie release The Pirate Bay 0.0 MB 25 / 3 English HD - 1080p │
|
||||
│ usenet 22 days ⛔ Some Other movie rele The Pirate Bay 0.0 MB English HD - 1080p │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ expression: output
|
||||
│ Details │ History │ File │ Cast │ Crew │ Manual Search │
|
||||
│──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Source ▼ Age ⛔ Title Indexer Size Peers Language Quality │
|
||||
│=> torrent 12 days ⛔ Some movie release The Pirate Bay 0.0 GB 25 / 3 English HD - 1080p │
|
||||
│ usenet 22 days ⛔ Some Other movie rele The Pirate Bay 0.0 GB English HD - 1080p │
|
||||
│=> torrent 12 days ⛔ Some movie release The Pirate Bay 0.0 MB 25 / 3 English HD - 1080p │
|
||||
│ usenet 22 days ⛔ Some Other movie rele The Pirate Bay 0.0 MB English HD - 1080p │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ expression: output
|
||||
│ Details │ History │ File │ Cast │ Crew │ Manual Search │
|
||||
│──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ Source ▼ Age ⛔ Title Indexer Size Peers Language Quality │
|
||||
│=> torrent 12 days ⛔ Some movie release The Pirate Bay 0.0 GB 25 / 3 English HD - 1080p │
|
||||
│ usenet 22 days ⛔ Some Other movie rele The Pirate Bay 0.0 GB English HD - 1080p │
|
||||
│=> torrent 12 days ⛔ Some movie release The Pirate Bay 0.0 MB 25 / 3 English HD - 1080p │
|
||||
│ usenet 22 days ⛔ Some Other movie rele The Pirate Bay 0.0 MB English HD - 1080p │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
@@ -22,7 +22,7 @@ use crate::ui::utils::{
|
||||
line_gauge_with_label, line_gauge_with_title, title_block,
|
||||
};
|
||||
use crate::ui::widgets::loading_block::LoadingBlock;
|
||||
use crate::utils::convert_to_gb;
|
||||
use crate::utils::format_size;
|
||||
use chrono::Duration;
|
||||
#[cfg(not(test))]
|
||||
use chrono::Utc;
|
||||
@@ -170,8 +170,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();
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ use crate::ui::widgets::confirmation_prompt::ConfirmationPrompt;
|
||||
use crate::ui::widgets::managarr_table::ManagarrTable;
|
||||
use crate::ui::widgets::popup::{Popup, Size};
|
||||
use crate::ui::{DrawUi, draw_input_box_popup, draw_popup};
|
||||
use crate::utils::convert_to_gb;
|
||||
use crate::utils::format_size;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "root_folders_ui_tests.rs"]
|
||||
@@ -66,11 +66,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()
|
||||
|
||||
@@ -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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -19,7 +19,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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ expression: output
|
||||
│ Library │ Downloads │ Blocklist │ │ u update all │ │
|
||||
│───────────────────────────────────│ enter details │─────────────────────────────────────│
|
||||
│ Name ▼ Typ│ esc cancel filter │e Monitored Tags │
|
||||
│=> Alex Per│ ↑ k scroll up │0 GB 🏷 alex │
|
||||
│=> Alex Per│ ↑ k scroll up │1 MB 🏷 alex │
|
||||
│ │ ↓ j scroll down │ │
|
||||
│ │ ← h previous tab │ │
|
||||
│ │ → l next tab │ │
|
||||
|
||||
+1
-1
@@ -22,7 +22,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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -19,7 +19,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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -19,7 +19,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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ expression: output
|
||||
│ Library │ Downloads │ Blocklist │ │ u update all │ │
|
||||
│───────────────────────────────────│ enter details │─────────────────────────────────────│
|
||||
│ Name ▼ │ esc cancel filter │e Monitored Tags │
|
||||
│=> Test Author │ ↑ k scroll up │0 GB 🏷 alex │
|
||||
│=> Test Author │ ↑ k scroll up │0 MB 🏷 alex │
|
||||
│ │ ↓ j scroll down │ │
|
||||
│ │ ← h previous tab │ │
|
||||
│ │ → l next tab │ │
|
||||
|
||||
+1
-1
@@ -22,7 +22,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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -19,7 +19,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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+1
-1
@@ -19,7 +19,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 │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
Loaded 100 of 117 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user