Skip to content

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

docs: update documentation for download organization, cli flags, and logging

Samir Hossains5b727841904a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 341a5b8..db44eca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
## [Unreleased]
### Added
+- **CLI Help Flag**: Added `-h` / `--help` CLI flags printing formatted usage, available options, and environment variables.
- **Full Mouse Support**: Complete mouse navigation throughout the application:
- Click search bar to edit; click suggestion items to search immediately.
- Click search results to select/preview; click again or double click to enter Details.
@@ -12,7 +13,8 @@
- **Contextual Downloads**:
- Pressing `d` or clicking `[Download]` while on the **Seasons** pane prompts to download the whole season (all episodes).
- Triggering download while on **Episodes** or **Streams** downloads that single episode.
-- **Custom Download Directory**:
+- **Organized Downloads & Custom Directory**:
+ - Structured Series downloads under `<base_dir>/Series/<Title>/Season <N>/<Title>_S<N:02>E<E:02>.<ext>` and Movies under `<base_dir>/Movies/<Title>/<Title>.<ext>`.
- Added `/download-dir <path>` slash command with directory creation and active write-probe validation.
- Added `/download-dir reset` (contextually suggested only when custom path is configured) to revert to OS default.
- Safe automatic fallback to default OS Downloads folder if custom path becomes inaccessible.
@@ -32,6 +34,10 @@
- Curated `/browse` views into 4 categorized shelves (Popular, Top Rated, Trending, Most Watched) with proper filtering.
### Fixed
+- **Terminal Restoration & Signal Handling**: Added `Ctrl+C` keyboard handling and asynchronous `SIGINT` signal listener to guarantee raw mode and alternate screen are always cleanly restored.
+- **Download Hierarchy & Numbering**: Fixed series media type detection and removed season/episode off-by-one addition.
+- **Parser UTF-8 Safety**: Hardened language detection boundary checks for multibyte titles against panics.
+- **Startup Screen Artifacts**: Removed early startup `eprintln!` to eliminate terminal screen artifacts before entering alternate screen mode.
- **Android / Termux Stability**: Removed `hickory-dns` from network dependencies to resolve NDK context panics and crashes on Android.
- **Screen Flickering & Blanking**:
- Eliminated full terminal clear on list navigation and infinite scroll pagination.
diff --git a/README.md b/README.md
index 6f67738..0ff19be 100644
--- a/README.md
+++ b/README.md
@@ -198,7 +198,7 @@ moviebox-tui
| `Ctrl+P` | Switch content provider |
| `Ctrl+T` | Toggle IPTV mode |
| `?` | Show help |
-| `q` | Quit |
+| `Ctrl+C` / `q` | Quit application and restore terminal |
### Mouse controls
@@ -241,7 +241,14 @@ By default, downloads are stored under the operating system Downloads directory:
```text
MovieBox-TUI/
├── Movies/
-└── Series/<title>/Season <number>/
+│ └── <title>/
+│ ├── <title>.<ext>
+│ └── <title>.<sub_ext>
+└── Series/
+ └── <title>/
+ └── Season <number>/
+ ├── <title>_S01E01.<ext>
+ └── <title>_S01E01.<sub_ext>
```
- **Custom download directory:** Use `/download-dir <path>` (e.g. `/download-dir ~/Videos` or `/download-dir /Volumes/Drive`) to change and persist your download folder. Use `/download-dir reset` to return to default.
diff --git a/docs/config.md b/docs/config.md
index 81fbb1a..d2f6c62 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -13,6 +13,7 @@ macOS `~/Library/Application Support/moviebox-tui`, Linux `~/.config/moviebox-tu
| `active_theme` | string | Theme name. |
| `bdix_enabled` | bool | Show BDIX providers (Bangladesh-only). |
| `default_player` | string or null | Preferred player: `mpv`, `iina`, `vlc`, `android`; absent/null until you choose one from the in-app picker. |
+| `download_dir` | string or null | Custom directory for video and subtitle downloads (null uses OS default). |
## Other persisted files
@@ -34,5 +35,5 @@ macOS `~/Library/Application Support/moviebox-tui`, Linux `~/.config/moviebox-tu
## CLI
+- `moviebox-tui --help` and `moviebox-tui -h` print the help manual and exit.
- `moviebox-tui --version`, `moviebox-tui -v`, and `moviebox-tui -V` print the version and exit.
-- No other flags.
diff --git a/docs/logging.md b/docs/logging.md
index 2f194c1..2887cfa 100644
--- a/docs/logging.md
+++ b/docs/logging.md
@@ -17,12 +17,10 @@ The active file is `moviebox-tui_rCURRENT.log`; rotated files are
- **Level** is controlled by `MOVIEBOX_LOG` (`off|warn|info|debug|trace`). Default is
`warn` in release builds, `info` in debug builds.
- **Rotation**: rotates at 5MB and keeps 3 files, so it stays small automatically.
-- **Terminal output**: normal log lines go only to the file. Startup still prints one
- short `stderr` line with the sanitized log path and active level before the TUI
- takes over, and invalid logging setup errors are also reported on `stderr`.
+- **Terminal output**: normal log lines go only to the file without writing to stdout or stderr, preventing screen bleed before entering alternate screen mode. Setup errors (if any) are reported on `stderr`.
- **Session header**: version, OS, and the log path are written on startup.
- **Panics**: the panic hook logs the payload to the file, then restores the terminal.
-- `--version` never creates a log file.
+- `--version` and `--help` never create a log file.
## What is logged