feat: add download info pane to TUI
Splits the downloads area 60/40 with a new info pane that adapts to the selected download's status: header (filename, user, size, status, save path, bitrate, length) plus queued-specific fields (queue position, peer slots, peer upload speed) or live progress/speed/ETA when transferring. Plumbs queue position via a new ClientOperation::PlaceInQueueUpdate so PlaceInQueueResponse messages from peers reach DownloadStore, and threads search-time metadata (bitrate, length, peer slots/speed) onto Download through a new download_with_metadata entry point.
This commit is contained in:
@@ -87,6 +87,14 @@ pub struct Transfer {
|
||||
pub filename: String,
|
||||
pub size: u64,
|
||||
}
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct DownloadMetadata {
|
||||
pub bitrate: Option<u32>,
|
||||
pub length_seconds: Option<u32>,
|
||||
pub peer_upload_speed: Option<u32>,
|
||||
pub peer_free_slots: Option<u8>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Download {
|
||||
pub username: String,
|
||||
@@ -96,6 +104,8 @@ pub struct Download {
|
||||
pub download_directory: String,
|
||||
pub status: DownloadStatus,
|
||||
pub sender: Sender<DownloadStatus>,
|
||||
pub queue_position: Option<u32>,
|
||||
pub metadata: DownloadMetadata,
|
||||
}
|
||||
|
||||
impl Download {
|
||||
|
||||
Reference in New Issue
Block a user