Skip to content

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

refactor(tui): remove redundant /addons slash command

Samir Hossainscea3f7495412
diff --git a/docs/controls.md b/docs/controls.md
index 4beb442..dbf1192 100644
--- a/docs/controls.md
+++ b/docs/controls.md
@@ -66,7 +66,6 @@ Type these commands directly into the search bar:
| `/list` | TV | View live TV channels |
| `/reload` | TV / Streaming / Addon | Reload active playlist (TV) or refresh catalog & search results |
| `/config` | TV / Addon | Manage IPTV playlists (TV) or Addon Manager (Addon Mode) |
-| `/addons` | Addon / Streaming | Open Addon Manager dialog |
| `/enable-streaming` | All | Enable Streaming Mode navigation in bottom dock |
| `/disable-streaming` | All | Disable Streaming Mode navigation |
| `/enable-tv` | All | Enable TV Mode navigation in bottom dock |
diff --git a/src/tui/app/search.rs b/src/tui/app/search.rs
index bdb060d..a0af8a2 100644
--- a/src/tui/app/search.rs
+++ b/src/tui/app/search.rs
@@ -234,15 +234,14 @@ impl App {
Some(true)
}
crate::tui::commands::ParsedCommand::Config => {
+ let current_mode = self.state.mode();
if current_mode == crate::tui::state::AppMode::Tv {
self.action_sender.send(Action::ShowTvConfig).ok();
- self.state.search_query.clear();
- self.state.input_mode = InputMode::Normal;
} else if current_mode == crate::tui::state::AppMode::Addon {
self.action_sender.send(Action::ShowAddonManager).ok();
- self.state.search_query.clear();
- self.state.input_mode = InputMode::Normal;
} else {
+ let ctrl_t = crate::tui::text::ctrl_key("T");
+ let ctrl_a = crate::tui::text::ctrl_key("A");
self.state.search_query.clear();
self.state.input_mode = InputMode::Normal;
self.state.notify(
@@ -253,19 +252,6 @@ impl App {
}
Some(true)
}
- crate::tui::commands::ParsedCommand::Addons => {
- if !self.state.addons_enabled {
- self.state.addons_enabled = true;
- self.persist_config();
- }
- if current_mode != crate::tui::state::AppMode::Addon {
- self.action_sender.send(Action::ToggleAddonMode).ok();
- }
- self.action_sender.send(Action::ShowAddonManager).ok();
- self.state.search_query.clear();
- self.state.input_mode = InputMode::Normal;
- Some(true)
- }
crate::tui::commands::ParsedCommand::DownloadDir(raw_arg) => {
self.state.search_query.clear();
self.state.input_mode = InputMode::Normal;
diff --git a/src/tui/commands.rs b/src/tui/commands.rs
index aa3ce8e..be7a7f2 100644
--- a/src/tui/commands.rs
+++ b/src/tui/commands.rs
@@ -7,7 +7,6 @@ pub enum SlashCommand {
List,
Reload,
Config,
- Addons,
DownloadDir,
Theme,
Update,
@@ -31,7 +30,6 @@ pub enum ParsedCommand<'a> {
List,
Reload,
Config,
- Addons,
DownloadDir(&'a str),
Theme,
Update,
@@ -49,13 +47,12 @@ pub enum ParsedCommand<'a> {
}
impl SlashCommand {
- pub const ALL: [Self; 20] = [
+ pub const ALL: [Self; 19] = [
Self::Browse,
Self::History,
Self::List,
Self::Reload,
Self::Config,
- Self::Addons,
Self::DownloadDir,
Self::Theme,
Self::Update,
@@ -79,7 +76,6 @@ impl SlashCommand {
Self::List => "/list",
Self::Reload => "/reload",
Self::Config => "/config",
- Self::Addons => "/addons",
Self::DownloadDir => "/download-dir",
Self::Theme => "/theme",
Self::Update => "/update",
@@ -110,7 +106,6 @@ impl SlashCommand {
}
}
Self::Config => "Configure IPTV playlists",
- Self::Addons => "Open Addon Manager dialog",
Self::DownloadDir => "View or change download folder",
Self::Theme => "Theme picker",
Self::Update => "Check for newer release",
@@ -137,7 +132,6 @@ impl SlashCommand {
Self::History => state.streaming_enabled && !state.is_tv_mode && !state.is_addon_mode,
Self::List | Self::Config => state.tv_enabled && state.is_tv_mode,
Self::Reload => state.is_tv_mode,
- Self::Addons => state.addons_enabled && (state.is_addon_mode || !state.is_tv_mode),
Self::EnableBdix => {
state.streaming_enabled
&& !state.is_tv_mode
@@ -205,7 +199,6 @@ impl SlashCommand {
"/list" => Some(ParsedCommand::List),
"/reload" => Some(ParsedCommand::Reload),
"/config" => Some(ParsedCommand::Config),
- "/addons" => Some(ParsedCommand::Addons),
"/download-dir" => Some(ParsedCommand::DownloadDir(arg)),
"/theme" => Some(ParsedCommand::Theme),
"/update" => Some(ParsedCommand::Update),