Skip to content

Commit

Permalink
fix: size human readable in details (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
micielski authored Aug 28, 2024
1 parent 2c82f69 commit 4b18dbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit 4b18dbc

Please sign in to comment.