Skip to content

Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.

refactor(tui): streamline status and error notifications for compact viewports

Samir Hossainsbfbc623d7b62
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fbbd9ba..fdeaaca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,10 +16,13 @@
- Updated `rustls` to `0.23.45` and `rustls-webpki` to `0.103.15`, resolving security advisory `RUSTSEC-2026-0285` (TLS 1.3 handshake boundary handling).
### Changed
-- **Concise Provider Error Messaging**:
+- **Concise Error and Status Messaging**:
- Streamlined `ProviderError::user_message` to output compact, high-signal status messages under 40 characters for mobile and compact viewports.
- Replaced sprawling raw socket errors and leaked endpoint URLs with clear failure reasons (`CircleFTP unreachable: requires BDIX network.`, `MovieBox timed out.`, `Cannot reach 4KHDHub.`, `No results found.`).
-
+ - Shortened 4KHDHub playback and download resolution timeout messages to fit single-row status lines (`4KHDHub timed out. Try another release or Ctrl+P.`).
+ - Sanitized subtitle download/write error strings to prevent raw filesystem/network error leaks.
+ - Compacted addon torrent stream warning to `Blocked {} torrent streams. HTTP only.`.
+ - Streamlined player crash fallback diagnostic to `Player exited (code {code}).`.
### Fixed
- **Update Modal Geometry & Symmetrical Border Padding**:
- Eliminated unnecessary dead vertical gap below action buttons in "Update Available" dialog by calculating exact rendered line heights (`update_modal_layout_with_env`) accounting for installation environment notices.
diff --git a/src/tui/app/download.rs b/src/tui/app/download.rs
index 584b654..44ed4a2 100644
--- a/src/tui/app/download.rs
+++ b/src/tui/app/download.rs
@@ -185,41 +185,41 @@ impl App {
Ok(Ok(response)) => match response.error_for_status() {
Ok(response) => match response.bytes().await {
Ok(bytes) => {
- if let Err(error) = tokio::fs::write(subtitle_path, bytes).await {
+ if tokio::fs::write(subtitle_path, bytes).await.is_err() {
sender
- .send(Action::SetStatus(format!(
- "Error: subtitle write failed: {error}"
- )))
+ .send(Action::SetStatus(
+ "Error: Subtitle save failed.".to_string(),
+ ))
.ok();
}
}
- Err(error) => {
+ Err(_) => {
sender
- .send(Action::SetStatus(format!(
- "Error: subtitle download failed: {error}"
- )))
+ .send(Action::SetStatus(
+ "Error: Subtitle download failed.".to_string(),
+ ))
.ok();
}
},
- Err(error) => {
+ Err(_) => {
sender
- .send(Action::SetStatus(format!(
- "Error: subtitle download failed: {error}"
- )))
+ .send(Action::SetStatus(
+ "Error: Subtitle download failed.".to_string(),
+ ))
.ok();
}
},
- Ok(Err(error)) => {
+ Ok(Err(_)) => {
sender
- .send(Action::SetStatus(format!(
- "Error: subtitle download failed: {error}"
- )))
+ .send(Action::SetStatus(
+ "Error: Subtitle download failed.".to_string(),
+ ))
.ok();
}
Err(_) => {
sender
.send(Action::SetStatus(
- "Error: subtitle download timed out".to_string(),
+ "Error: Subtitle download timed out.".to_string(),
))
.ok();
}
@@ -555,7 +555,7 @@ impl App {
log::error!("4KHDHub download resolve timed out");
sender
.send(Action::SetStatus(
- "Error: 4KHDHub download resolution timed out. Select another release (e.g. 1080p) or press Ctrl+P for MovieBox.".to_string(),
+ "Error: 4KHDHub timed out. Try another release or Ctrl+P.".to_string(),
))
.ok();
}
diff --git a/src/tui/app/playback.rs b/src/tui/app/playback.rs
index 594d135..dedf5b3 100644
--- a/src/tui/app/playback.rs
+++ b/src/tui/app/playback.rs
@@ -675,7 +675,7 @@ impl App {
sender.send(Action::PlayerExited).ok();
sender
.send(Action::SetStatus(
- "Error: 4KHDHub stream resolution timed out. Select another release (e.g. 1080p) or press Ctrl+P for MovieBox.".to_string(),
+ "Error: 4KHDHub timed out. Try another release or Ctrl+P.".to_string(),
))
.ok();
}
@@ -934,16 +934,10 @@ impl App {
"Switch to Android Player in /settings.".to_string(),
)
} else {
- let display_err = if error_msg.is_empty() {
- "No error output provided by player.".to_string()
+ let formatted_msg = if let Some(c) = code {
+ format!("Player exited (code {c}).")
} else {
- error_msg.lines().last().unwrap_or(&error_msg).to_string()
- };
- let formatted_msg = if display_err.starts_with("Player exited with status code")
- {
- display_err
- } else {
- format!("{display_err} (code {code_str})")
+ "Player process terminated.".to_string()
};
("Playback Failed", formatted_msg)
};
diff --git a/src/tui/app/requests.rs b/src/tui/app/requests.rs
index c5e174e..0ed20cf 100644
--- a/src/tui/app/requests.rs
+++ b/src/tui/app/requests.rs
@@ -1363,10 +1363,12 @@ impl App {
.await;
if !blocked_addons.is_empty() {
- sender.send(Action::SetStatus(format!(
- "Warning: {} streams blocked (raw torrents). Only HTTP streams are supported.",
- blocked_addons.join(", ")
- ))).ok();
+ sender
+ .send(Action::SetStatus(format!(
+ "Blocked {} torrent streams. HTTP only.",
+ blocked_addons.join(", ")
+ )))
+ .ok();
}
if !releases.is_empty() {