Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make size human readable in details #110

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions rm-main/src/tui/tabs/torrents/popups/details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ratatui::{
widgets::{block::Title, Block, BorderType, Clear, Paragraph, Wrap},
};
use rm_config::CONFIG;
use rm_shared::action::Action;
use rm_shared::{action::Action, utils::bytes_to_human_format};
use style::Styled;

use crate::tui::{
Expand Down Expand Up @@ -76,7 +76,10 @@ impl Component for DetailsPopup {

let ratio = Line::from(format!("Ratio: {}", self.torrent.upload_ratio));

let size_line = Line::from(format!("Size: {}", self.torrent.size_when_done));
let size_line = Line::from(format!(
"Size: {}",
bytes_to_human_format(self.torrent.size_when_done)
));

let activity_line = Line::from(format!("Last activity: {}", self.torrent.activity_date));

Expand Down
2 changes: 1 addition & 1 deletion rm-main/src/tui/tabs/torrents/tasks/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Component for Default {
line.push_span(Span::raw(format!("{} ", CONFIG.icons.help)));
}
line.push_span(Span::styled(keys, keybinding_style()));
line.push_span(Span::raw(" - details"));
line.push_span(Span::raw(" - view torrent"));
}
}
f.render_widget(line, rect);
Expand Down
Loading