Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
refactor(tui): clean searchbar provider switch and render stream tag pills
Samir Hossainsf7ae08e15af9
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 9d5b09d..4e98489 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,7 @@- Gated background search pagination in `src/tui/app/navigation.rs` so arrow navigation on result sets smaller than the visible viewport never triggers background page fetches.- Added `search_exhausted` tracking in `src/tui/state.rs` and `src/tui/app/requests.rs`, stopping pagination crawls when provider search returns fewer than 15 items or zero query-matching results.- Preserved stable card slot positions during search pagination in `src/tui/app/requests.rs` by appending subsequent page items to the list rather than re-sorting the entire array out from under the cursor.+ - Removed redundant "Provider: <name>" status message override from the search bar on provider switch in `src/tui/app/navigation.rs`, preserving the clean search placeholder while the active provider pill displays on the right.- **Media Playback & Buffering Engine**:- Prioritized native desktop media players (`mpv`, `VLC`) over Android intent openers in `src/player.rs` when an active X11/Wayland display server (`$DISPLAY`, `$WAYLAND_DISPLAY`) is detected, preventing Ubuntu Xfce (udroid/PRoot) and Termux:X11 desktop sessions from dispatching playback to external Android app choosers.- Configured `mpv` and `IINA` with initial cache buffering (`--cache-pause-initial=yes`) and resilient re-buffer cushion (`--cache-pause-wait=10`) in `src/player.rs`, preventing repeated 2-second stutter loops on bandwidth-constrained CDN streams.@@ -23,6 +24,7 @@- Replaced allocating `to_string()` hash set checks in `src/favorites.rs` with zero-allocation borrowed string comparisons in `is_favorite`, eliminating 400+ heap allocations per second during search grid rendering.- Eliminated redundant 100ms idle tick redraws on static home screens in `src/tui/app/system.rs`, dropping idle CPU consumption to zero.- Replaced per-card `Layout::split` invocations in `src/tui/screens/home.rs` with direct row arithmetic calculations, avoiding repeated layout solver overhead across search result slots.+ - Rendered stream media tags (HDR, ATMOS, 5.1, HEVC, AV1, WEB-DL) in `src/tui/screens/details.rs` using styled surface pill spans instead of raw concatenated text, pruning transient string vectors in the table mapping loop.### Changed- **Documentation & Cross-Platform Terminal Compatibility**:- Documented native Windows Terminal Sixel image support requirements (`v1.22+` via Microsoft Store) in `docs/cross-platform.md` and `README.md`, clarifying that no third-party terminal or configuration is required on Windows.diff --git a/src/tui/app/navigation.rs b/src/tui/app/navigation.rsindex cb87777..de3f938 100644--- a/src/tui/app/navigation.rs+++ b/src/tui/app/navigation.rs@@ -55,8 +55,6 @@ impl App {self.state.search_list_state.select(None);self.state.resource_list_state.select(None);self.state.dirty = true;- self.state- .set_status_default(format!("Provider: {}", provider.label()));self.persist_config();if provider == ProviderKind::MovieBox {let client = self.service.client.clone();diff --git a/src/tui/screens/details.rs b/src/tui/screens/details.rsindex d874e46..271721a 100644--- a/src/tui/screens/details.rs+++ b/src/tui/screens/details.rs@@ -1422,27 +1422,14 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)let codec_str = codec.to_uppercase();let tags = extract_media_tags(&file.filename, &codec_str);- let mut tag_parts = Vec::new();- if let Some(hdr) = tags.hdr {- tag_parts.push(hdr);- }- if let Some(codec_tag) = tags.codec {- tag_parts.push(codec_tag);+ let media_tag_spans =+ crate::tui::widgets::render_media_tag_spans(&tags, theme, state.basic_terminal);+ let tags_cell = if !media_tag_spans.is_empty() {+ Cell::from(ratatui::text::Line::from(media_tag_spans))} else if codec != "None" && !codec.is_empty() {- tag_parts.push(codec_str.as_str());- }- if let Some(audio) = tags.audio {- tag_parts.push(audio);- }- if let Some(source) = tags.source {- tag_parts.push(source);- }- let sep = if state.basic_terminal { " - " } else { " · " };- let tags_or_codec = tag_parts.join(sep);- let tags_col = if tags_or_codec.is_empty() {- "-".to_string()+ Cell::from(Span::styled(codec_str, secondary_style))} else {- tags_or_codec+ Cell::from(Span::styled("-", secondary_style))};let cells: Vec<Cell> = if is_ultra_compact {@@ -1462,7 +1449,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)vec![Cell::from(ratatui::text::Line::from(res_badge)),Cell::from(Span::styled(size_formatted.clone(), primary_style)),- Cell::from(Span::styled(tags_col, secondary_style)),+ tags_cell.clone(),Cell::from(Span::styled(upload_by, secondary_style)),Cell::from(Span::styled(release_title, primary_style)),]@@ -1470,7 +1457,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)vec![Cell::from(ratatui::text::Line::from(res_badge)),Cell::from(Span::styled(size_formatted.clone(), primary_style)),- Cell::from(Span::styled(tags_col, secondary_style)),+ tags_cell,Cell::from(Span::styled(release_title, primary_style)),]};