Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
fix(tv): accurate help and working refresh in tv mode
Samir Hossainsf6c973aad84a
diff --git a/src/tui/app.rs b/src/tui/app.rsindex 9d6fe06..9ecd6bd 100644--- a/src/tui/app.rs+++ b/src/tui/app.rs@@ -1778,10 +1778,9 @@ impl App {let query = self.state.search_query.trim().to_string();if self.state.is_tv_mode {if query.is_empty() {- self.state.set_status(- "TV Mode channels are loaded from local config.".to_string(),- 150,- );+ self.state+ .set_status("Reloading TV playlists...".to_string(), 150);+ self.reload_tv_playlists();} else {self.action_sender.send(Action::Search {@@ -2165,10 +2164,7 @@ impl App {self.state.search_query.clear();return None;}- if matches!(- lower_query.as_str(),- "/home" | "/discover" | "/movies" | "/shows" | "/tvshows" | "/anime"- ) {+ if lower_query.starts_with('/') && lower_query != "/list" {self.state.set_status("Switch to streaming mode to use this command".to_string(),150,diff --git a/src/tui/screens/help.rs b/src/tui/screens/help.rsindex a90f64a..dbe7e5c 100644--- a/src/tui/screens/help.rs+++ b/src/tui/screens/help.rs@@ -7,7 +7,7 @@ use ratatui::{};pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {- let mut help_text = vec![+ let global = vec![Line::from(vec![Span::styled(" Global",theme.header.add_modifier(ratatui::style::Modifier::BOLD),@@ -24,20 +24,13 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {Span::styled(" [Esc] ", theme.header),Span::styled("Go Back / Clear", theme.text),]),- Line::from(vec![- Span::styled(" [Ctrl+P] ", theme.header),- Span::styled(- format!(- "Switch Provider (active: {})",- state.active_provider.label()- ),- theme.text,- ),- ]),Line::from(vec![Span::styled(" [Ctrl+T] ", theme.header),Span::styled("Switch Streaming / TV Mode", theme.text),]),+ ];++ let navigation = vec![Line::from(vec![]),Line::from(vec![Span::styled(" Navigation",@@ -49,28 +42,19 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {]),Line::from(vec![Span::styled(" [←] / [→] ", theme.header),- Span::styled("Page Through Search Results", theme.text),- ]),- Line::from(vec![- Span::styled(" [Tab] ", theme.header),- Span::styled("Next Details Pane", theme.text),- ]),- Line::from(vec![- Span::styled(" [Shift+Tab]", theme.header),- Span::styled("Previous Details Pane", theme.text),+ Span::styled("Page Through Results", theme.text),]),Line::from(vec![Span::styled(" [Enter] ", theme.header),Span::styled("Select / Submit", theme.text),]),- Line::from(vec![]),];- if state.is_tv_mode {- help_text.remove(4);- }+ let mut help_text = global;if state.is_tv_mode {+ help_text.extend(navigation);help_text.extend(vec![+ Line::from(vec![]),Line::from(vec![Span::styled(" TV Controls",theme.header.add_modifier(ratatui::style::Modifier::BOLD),@@ -79,42 +63,41 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {Span::styled(" [Enter] ", theme.header),Span::styled("Play Channel", theme.text),]),- Line::from(vec![- Span::styled(" /list ", theme.header),- Span::styled("Show Available Channels", theme.text),- ]),- Line::from(vec![- Span::styled(" /config ", theme.header),- Span::styled("Open TV Config Popup", theme.text),- ]),- Line::from(vec![]),- Line::from(vec![Span::styled(- " System",- theme.header.add_modifier(ratatui::style::Modifier::BOLD),- )]),Line::from(vec![Span::styled(" [r] ", theme.header),- Span::styled("Refresh Channels/Search", theme.text),+ Span::styled("Reload Playlists", theme.text),]),Line::from(vec![- Span::styled(" /clear-cache ", theme.header),- Span::styled("Clear App Cache", theme.text),+ Span::styled(" /list ", theme.header),+ Span::styled("Show Available Channels", theme.text),]),Line::from(vec![- Span::styled(" /enable-bdix ", theme.header),- Span::styled("Enable BDIX FTP", theme.text),+ Span::styled(" /config ", theme.header),+ Span::styled("Add / Remove Playlists", theme.text),]),+ ]);+ } else {+ help_text.extend(vec![Line::from(vec![+ Span::styled(" [Ctrl+P] ", theme.header),+ Span::styled(+ format!(+ "Switch Provider (active: {})",+ state.active_provider.label()+ ),+ theme.text,+ ),+ ])]);+ help_text.extend(navigation);+ help_text.extend(vec![Line::from(vec![- Span::styled(" /disable-bdix ", theme.header),- Span::styled("Disable BDIX FTP", theme.text),+ Span::styled(" [Tab] ", theme.header),+ Span::styled("Next Details Pane", theme.text),]),Line::from(vec![- Span::styled(" /theme ", theme.header),- Span::styled("Change UI Theme", theme.text),+ Span::styled(" [Shift+Tab]", theme.header),+ Span::styled("Previous Details Pane", theme.text),]),- ]);- } else {- help_text.extend(vec![+ Line::from(vec![]),Line::from(vec![Span::styled(" Playback & Download",theme.header.add_modifier(ratatui::style::Modifier::BOLD),@@ -140,10 +123,6 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {Span::styled(" /home ", theme.header),Span::styled("Trending & Featured", theme.text),]),- Line::from(vec![- Span::styled(" /discover ", theme.header),- Span::styled("Trending & Featured", theme.text),- ]),Line::from(vec![Span::styled(" /movies ", theme.header),Span::styled("Discover Movies", theme.text),