Skip to content

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

refactor: optimize UI code, update README with comprehensive documentation, and improve project structure

Samir Hossains6627fb3fe2aa
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 0000000..55bdcea
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,50 @@
+name: Bug report
+description: Something is broken or not working as expected.
+title: "bug: "
+labels: ["bug"]
+body:
+ - type: textarea
+ id: description
+ attributes:
+ label: What happened?
+ description: Describe the bug and what you expected instead.
+ validations:
+ required: true
+
+ - type: textarea
+ id: reproduction
+ attributes:
+ label: Steps to reproduce
+ placeholder: |
+ 1. Run `moviebox-tui`
+ 2. ...
+ validations:
+ required: true
+
+ - type: input
+ id: version
+ attributes:
+ label: Version
+ description: Find it with `cargo install --list`.
+ placeholder: "0.1.2"
+ validations:
+ required: true
+
+ - type: dropdown
+ id: os
+ attributes:
+ label: Operating system
+ options:
+ - macOS
+ - Linux
+ - Windows
+ validations:
+ required: true
+
+ - type: input
+ id: terminal
+ attributes:
+ label: Terminal
+ placeholder: "Ghostty, iTerm2, Kitty, WezTerm, Alacritty, ..."
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 0000000..c7aed51
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,20 @@
+name: Feature request
+description: Suggest a new feature or improvement.
+title: "feat: "
+labels: ["enhancement"]
+body:
+ - type: textarea
+ id: problem
+ attributes:
+ label: What problem does this solve?
+ description: What are you trying to do that MovieBox-Tui makes hard or impossible?
+ validations:
+ required: true
+
+ - type: textarea
+ id: solution
+ attributes:
+ label: Proposed solution
+ description: Optional. How could it work?
+ validations:
+ required: false
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..d4e5083
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,10 @@
+## What does this PR do?
+
+<!-- One or two sentences. Link related issues with `Closes #NN`. -->
+
+## Checklist
+
+- [ ] `cargo fmt --all` passes
+- [ ] `cargo clippy --all-targets --all-features -- -D warnings` passes
+- [ ] `cargo build` succeeds
+- [ ] Docs updated if this changes features, keybindings, or usage
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 905b375..9fe9818 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,39 +1,93 @@
# Contributing to MovieBox-Tui
-Thank you for your interest in contributing to MovieBox-Tui!
+Thanks for taking the time to contribute. Bug reports, ideas, docs improvements, and pull requests are all welcome.
-## Pull Request Process
+If you're planning a large or breaking change, please open an issue first so we can talk it through before you invest significant time.
-1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
-2. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
-3. Ensure your code passes all linting (`cargo clippy -- -D warnings`) and formatting (`cargo fmt --check`) checks.
-4. Add tests for any new features or bug fixes.
-5. The PR will be reviewed by a maintainer and merged when approved.
+## Getting set up
-## Development setup
+You'll need Rust **1.85 or newer** (edition 2024). Install it via [rustup.rs](https://rustup.rs/).
-Ensure you have the latest stable Rust compiler.
-```sh
-rustup default stable
-```
+```bash
+# Fork on GitHub, then clone your fork
+git clone https://github.com/<your-username>/MovieBox-Tui.git
+cd MovieBox-Tui
-### Running Tests
+# Add the upstream remote to keep in sync
+git remote add upstream https://github.com/mesamirh/MovieBox-Tui.git
-Run the full test suite locally:
-```sh
-cargo test
+# Build and run
+cargo run --release
```
-### Code Style
+To test playback and download features locally, install `mpv` (see the [README](README.md#requirements)).
-We follow standard Rust idioms.
-All code must be formatted using `rustfmt`.
+## Project layout
-```sh
-cargo fmt
-```
+The app has two layers. See the [Project layout section](README.md#project-layout) in the README for the full tree.
+
+Short version:
+
+- `src/providers/moviebox/` is the HTTP client for the MovieBox API.
+- `src/tui/` is the interface, built on Ratatui.
+- `src/tui/app.rs` is the central event loop. Every user action and background task funnels through its `match` statement. That's the best place to start reading.
+
+The app is message-driven. User input and background tasks produce `Action` values, handled in `app.rs`. When adding behavior, prefer adding a new `Action` variant over blocking the UI thread.
+
+## Workflow
+
+1. Create a branch off `main`:
-Use `clippy` to catch common mistakes.
-```sh
+ ```bash
+ git checkout main
+ git pull upstream main
+ git checkout -b feat/short-description
+ ```
+
+2. Make your change in small, logical commits.
+3. Run the checks below.
+4. Push and open a pull request against `main`.
+
+## Before opening a PR
+
+Run these locally. All must pass.
+
+```bash
+cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
+cargo build
+```
+
+Guidelines:
+
+- Follow idiomatic Rust and standard `rustfmt` defaults. Don't hand-format.
+- Keep the async, message-passing architecture intact.
+- Avoid panics on paths that handle network or user input.
+- Don't add new dependencies without a good reason. Mention it in the PR if you do.
+
+## Commit messages
+
+Follow [Conventional Commits](https://www.conventionalcommits.org/). Keep the subject concise and in the imperative mood.
+
+Examples:
+
+```
+feat: add support for custom mpv arguments
+fix: prevent panic when clipboard is unavailable
+docs: document /anime discover command
+refactor: extract stream resolution into helper
```
+
+Common types: `feat`, `fix`, `refactor`, `docs`, `style`, `perf`, `chore`.
+
+## Pull requests
+
+Keep PRs focused on a single concern. Large PRs mixing unrelated changes may be asked to be split.
+
+In your PR description, explain what changed and why. Link related issues (`Closes #12`) and include screenshots or recordings for anything visible in the UI.
+
+Never commit `target/`, editor settings, or debug dump files.
+
+## License
+
+By contributing, you agree that your contributions will be dual-licensed under the [MIT](LICENSE-MIT) and [Apache-2.0](LICENSE-APACHE) licenses, consistent with the rest of the project.
diff --git a/Cargo.toml b/Cargo.toml
index c6354f9..30bd5e6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,12 +1,12 @@
[package]
name = "moviebox-tui"
-version = "0.1.2"
+version = "0.1.3"
edition = "2024"
-description = "A terminal user interface (TUI) client for MovieBox API."
+description = "A terminal client for finding and streaming movies, TV shows, and anime from the MovieBox catalog."
repository = "https://github.com/mesamirh/MovieBox-Tui"
homepage = "https://github.com/mesamirh/MovieBox-Tui"
license = "MIT OR Apache-2.0"
-keywords = ["tui", "moviebox", "scraper", "streaming", "cli"]
+keywords = ["tui", "moviebox", "streaming", "movies", "cli"]
categories = ["command-line-utilities", "multimedia"]
readme = "README.md"
rust-version = "1.85.0"
diff --git a/LICENSE-APACHE b/LICENSE-APACHE
new file mode 100644
index 0000000..a5f1969
--- /dev/null
+++ b/LICENSE-APACHE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or Derivative
+ Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work, excluding
+ those notices that do not pertain to any part of the Derivative
+ Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and do
+ not modify the License. You may add Your own attribution notices
+ within Derivative Works that You distribute, alongside or as an
+ addendum to the NOTICE text from the Work, provided that such
+ additional attribution notices cannot be construed as modifying
+ the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2026 MovieBox Contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/README.md b/README.md
index 38e66bf..ed9ce12 100644
--- a/README.md
+++ b/README.md
@@ -1,59 +1,391 @@
+<div align="center">
+
# MovieBox-Tui
-A lightning fast, zero-config terminal user interface (TUI) for streaming movies and TV series directly from your terminal.
+A terminal client for finding and streaming movies, TV shows, and anime from your keyboard.
+
+[![Crates.io](https://img.shields.io/crates/v/moviebox-tui.svg?logo=rust)](https://crates.io/crates/moviebox-tui)
+[![Downloads](https://img.shields.io/crates/d/moviebox-tui.svg)](https://crates.io/crates/moviebox-tui)
+[![License](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](#license)
+[![Rust](https://img.shields.io/badge/rust-1.85%2B-orange.svg?logo=rust)](#requirements)
+
+<br>
+
+<p align="center">
+ <img src="assets/screenshots/01-home.png" alt="MovieBox-Tui home screen" width="88%"/>
+</p>
+
+</div>
+
+---
+
+## What is this?
+
+**MovieBox-Tui** is a terminal UI I built to search MovieBox's public catalog and stream the results in my favorite video player, without leaving the terminal. It talks to the MovieBox API directly, resolves the video URLs it returns, and hands them off to `mpv`, `IINA`, or `VLC`.
+
+No browsers, no ads, no login walls, no configuration. Type a title, pick a quality, watch.
+
+> **Note:** This project is a client for a third-party service. It does not host, store, or redistribute any media. It only resolves the links the upstream API returns. It is intended strictly for educational and personal use. You are responsible for complying with copyright law in your jurisdiction.
+
+---
+
+## Demo
+
+A short walkthrough of the app in action:
+
+<div align="center">
+
+**[Watch the demo on YouTube](https://youtu.be/0L1Wc3cwMCc)**
+
+</div>
+
+---
+
+## Contents
+
+- [What it can do](#what-it-can-do)
+- [Screenshots](#screenshots)
+- [Platform support](#platform-support)
+- [Requirements](#requirements)
+- [Install](#install)
+- [Getting started](#getting-started)
+- [Keybindings](#keybindings)
+- [How it works](#how-it-works)
+- [Project layout](#project-layout)
+- [Troubleshooting](#troubleshooting)
+- [Contributing](#contributing)
+- [Acknowledgements](#acknowledgements)
+- [License](#license)
+
+---
+
+## What it can do
+
+**Search and discovery**
+- Type-to-search with live, debounced suggestions.
+- Slash commands to browse curated feeds: `/movies`, `/shows`, `/anime`, `/discover`.
+- Each result shows a poster, release year, and (when highlighted) IMDb rating and genres.
+
+**Playback**
+- Detects `mpv`, `IINA`, and `VLC` at startup. You get a picker for whatever you have installed.
+- Full season and episode browsing for TV series and anime, with per-episode stream resolution.
+- Multiple resolutions (1080p, 720p, 480p, 360p) are fetched in parallel and listed by quality.
+- Attach external subtitle tracks, and switch between available audio dubs before playing.
+- If a stream fails or expires, hit <kbd>R</kbd> to re-resolve it.
+
+**Downloading and sharing**
+- Built-in multi-connection downloader. Uses up to 16 parallel connections when the source allows range requests, with live speed, ETA, progress bar, and cancel.
+- Copy any direct stream URL to your clipboard with a single keystroke.
+- Downloads go to your system Downloads folder.
+
+**The interface**
+- Real poster art rendered inline in terminals that support graphics (Kitty, WezTerm, iTerm2, Ghostty, foot, etc.).
+- In-app notification when a newer version is published to crates.io.
+- The details view shows the poster, IMDb rating, year, genres, duration, country, and full description alongside the season, episode, and stream panels.
+
+---
+
+## Screenshots
+
+<details open>
+<summary><b>Home and search</b></summary>
+<br>
+
+| Home | Search results |
+| :---: | :---: |
+| <img src="assets/screenshots/01-home.png" alt="Home screen" width="480"> | <img src="assets/screenshots/02-search-results.png" alt="Search results" width="480"> |
+
+</details>
+
+<details>
+<summary><b>Details view</b></summary>
+<br>
+
+| Movie | TV series |
+| :---: | :---: |
+| <img src="assets/screenshots/03-movie-details.png" alt="Movie details" width="480"> | <img src="assets/screenshots/04-series-details.png" alt="Series details" width="480"> |
+
+</details>
+
+<details>
+<summary><b>Discover feeds</b></summary>
+<br>
+
+| Movies | Series | Anime |
+| :---: | :---: | :---: |
+| <img src="assets/screenshots/05-discover-movies.png" alt="Discover movies" width="320"> | <img src="assets/screenshots/06-discover-series.png" alt="Discover series" width="320"> | <img src="assets/screenshots/07-discover-anime.png" alt="Discover anime" width="320"> |
+
+</details>
+
+<details>
+<summary><b>Help overlay</b></summary>
+<br>
+
+<p align="center">
+ <img src="assets/screenshots/08-help.png" alt="Keybindings help overlay" width="70%">
+</p>
+
+</details>
+
+---
+
+## Platform support
+
+| Platform | Status |
+| :--- | :--- |
+| **macOS** | Fully supported. Developed and tested here. Ghostty, iTerm2, and Kitty all render posters correctly. |
+| **Linux** | Experimental. Should work on any terminal with graphics-protocol support. Not extensively tested. |
+| **Windows** | Experimental. Expect bugs, especially around inline image rendering. Contributions welcome. |
+
+---
+
+## Requirements
+
+You need three things:
+
+1. **A video player.** `mpv` is the default and the most reliable. `IINA` (macOS) and `VLC` also work. The app detects whichever you have installed.
+2. **A terminal at least 85Γ—24.** Anything smaller and the app will show a message asking you to enlarge it.
+3. **Rust 1.85 or newer** (edition 2024), only if you want to build from source. See [rustup.rs](https://rustup.rs/). If you install from crates.io, you already have it.
+
+For inline poster art, you'll want a terminal that speaks a graphics protocol: **Kitty, WezTerm, iTerm2, Ghostty**, or **foot**. Other terminals still work fine, you just get placeholder blocks instead of images.
+
+<details>
+<summary><b>How to install a video player</b></summary>
+<br>
+
+```bash
+# macOS
+brew install mpv
+# or, for a native-feel alternative
+brew install --cask iina
+
+# Debian / Ubuntu
+sudo apt install mpv
+
+# Arch Linux
+sudo pacman -S mpv
+
+# Fedora
+sudo dnf install mpv
+
+# Windows (Chocolatey)
+choco install mpv
+```
+
+MovieBox-Tui auto-detects whichever players you have installed on the first run.
+
+</details>
+
+---
-## Installation
+## Install
-```sh
+The recommended way is to install from crates.io:
+
+```bash
cargo install moviebox-tui
```
-*Note: Requires `mpv` installed on your system for video playback.*
+Make sure `~/.cargo/bin` is on your `PATH`, then run:
+
+```bash
+moviebox-tui
+```
+
+<details>
+<summary><b>Building from source</b></summary>
+<br>
-## Usage
+If you want a local checkout or a development version:
-Launch the app from your terminal:
+```bash
+git clone https://github.com/mesamirh/MovieBox-Tui.git
+cd MovieBox-Tui
+cargo install --path .
+```
-```sh
+Or run it directly without installing:
+
+```bash
+cargo run --release
+```
+
+</details>
+
+---
+
+## Getting started
+
+Launch the app:
+
+```bash
moviebox-tui
```
-- **Search**: Press `/` to search for movies or shows.
-- **Play**: Select a result and press `Enter` to stream instantly.
-- **Logs**: Press `Ctrl+L` to view internal network logs.
-- **Quit**: Press `q` or `Esc` to exit.
+You'll land on the home screen. From there:
-## Features
+1. Just start typing. The search bar activates automatically and live suggestions appear as you type.
+2. Or use a discover command: type `/movies`, `/shows`, `/anime`, or `/discover` and press <kbd>Enter</kbd> to browse curated feeds.
+3. Move through results with <kbd>Up</kbd>/<kbd>Down</kbd>. The selected result loads a poster preview with IMDb rating and genres.
+4. Press <kbd>Enter</kbd> to open the details view.
+5. For a TV series, pick a season and episode. If multiple language dubs are available, you'll be asked to pick one.
+6. Choose a stream quality and hit <kbd>Enter</kbd> to play in `mpv`, or <kbd>o</kbd> to pick a different player.
-- Instant streaming with `mpv`
-- Full metadata (seasons, episodes, dubs, and subs)
-- Built in geo-unblocking (zero VPN required)
-- Copy direct stream URLs to clipboard
+Press <kbd>?</kbd> at any time to see all keybindings.
-## Screenshots
+---
+
+## Keybindings
+
+### Global
+
+| Key | Action |
+| :--- | :--- |
+| any letter | Focus the search input and start typing |
+| <kbd>?</kbd> | Toggle the help overlay |
+| <kbd>Esc</kbd> | Go back, clear search, or close popup |
+| <kbd>q</kbd> | Quit |
+| <kbd>Ctrl</kbd>+<kbd>C</kbd> | Force quit |
+
+### Navigation
+
+| Key | Action |
+| :--- | :--- |
+| <kbd>Up</kbd>/<kbd>Down</kbd> | Move selection |
+| <kbd>Left</kbd>/<kbd>Right</kbd> | Switch panels or page through results |
+| <kbd>Enter</kbd> | Select or confirm |
+| <kbd>Esc</kbd> | Go back (details screen) |
+
+### On the details screen
+
+| Key | Action |
+| :--- | :--- |
+| <kbd>Enter</kbd> | Play the selected stream in `mpv` |
+| <kbd>o</kbd> | Choose a different player (`mpv`, `IINA`, or `VLC`) |
+| <kbd>R</kbd> | Refresh streams. Useful when a link expires or fails. |
+| <kbd>d</kbd> | Download the selected stream |
+| <kbd>c</kbd> | Copy the direct stream URL to the clipboard |
+| <kbd>x</kbd> | Cancel an in-progress download |
+
+---
+
+## How it works
+
+The app has two layers.
+
+The **provider layer** (`src/providers/moviebox/`) is a small HTTP client for the MovieBox API. It rotates through a pool of API hosts, signs each request with an HMAC-MD5 signature, and retries automatically on transient failures. When you open a title, it fires off requests for every resolution in parallel and deduplicates the results. That is why picking a quality feels instant.
+
+The **TUI layer** (`src/tui/`) is where everything you see happens. It is built on [Ratatui](https://ratatui.rs) and driven by an async event loop. Every keystroke, network response, and background task becomes an `Action` on a single channel, so the interface never blocks. Poster images decode on background tasks and get cached in an LRU so scrolling through search results stays smooth.
+
+Playback is not reinvented. The app just spawns your video player with the resolved URL and any subtitle track you picked. That means all the polish (hotkeys, subtitles, seeking) comes from mpv, IINA, or VLC, exactly as you would expect them to behave.
+
+---
+
+## Project layout
+
+```
+src/
+β”œβ”€β”€ main.rs Binary entry: terminal + tokio setup
+β”œβ”€β”€ lib.rs Library root
+β”œβ”€β”€ providers/
+β”‚ └── moviebox/
+β”‚ β”œβ”€β”€ client.rs HTTP client, host-pool failover, retries
+β”‚ β”œβ”€β”€ crypto.rs HMAC-MD5 request signing + device spoofing
+β”‚ └── mod.rs High-level API calls
+└── tui/
+ β”œβ”€β”€ app.rs Event loop and Action handlers
+ β”œβ”€β”€ action.rs The Action enum (every event in one place)
+ β”œβ”€β”€ event.rs Crossterm to Action bridge
+ β”œβ”€β”€ state.rs Application state
+ β”œβ”€β”€ theme.rs Colors
+ └── screens/
+ β”œβ”€β”€ home.rs Home, search, and result list
+ β”œβ”€β”€ details.rs Movie / series detail view
+ └── help.rs Keybindings overlay
+```
+
+If you're poking around the code, `src/tui/app.rs` is the map. Every user action, network response, and background task funnels through its match statement.
+
+---
+
+## Troubleshooting
<details>
-<summary>Click to view screenshots</summary>
+<summary><b>Posters show up as colored blocks instead of images</b></summary>
+<br>
+
+Your terminal doesn't support inline graphics. The app falls back to text placeholders. Try Kitty, WezTerm, iTerm2, Ghostty, or foot if you want the images.
+
+</details>
+
+<details>
+<summary><b>"mpv player not found in PATH"</b></summary>
+<br>
+
+Install `mpv` (see [Requirements](#requirements)), or press <kbd>o</kbd> to pick `IINA` or `VLC` if you already have those. Player detection happens once at startup, so install first, then launch the app.
+</details>
+
+<details>
+<summary><b>"Terminal too small"</b></summary>
<br>
-### Home Screen
-<img src="assets/screenshots/1-home.jpg" alt="Home Screen" width="800">
+The app needs at least **85Γ—24** characters. Enlarge the window or shrink the font.
-### Search Results
-<img src="assets/screenshots/2-search.jpg" alt="Search Results" width="800">
+</details>
-### Movie Details
-<img src="assets/screenshots/3-movie.jpg" alt="Movie Details" width="800">
+<details>
+<summary><b>Nothing found, stream won't play, or link expired</b></summary>
+<br>
+
+Direct stream URLs are short-lived and expire after some time. On the details screen, press <kbd>R</kbd> to re-resolve. If a title has no streams at all, it may be unreleased on MovieBox or temporarily gone from their catalog.
+
+</details>
-### Stream Selection
-<img src="assets/screenshots/4-streams.jpg" alt="Stream Selection" width="800">
+<details>
+<summary><b>Downloads are slow or crawl</b></summary>
+<br>
-### TV Series Details
-<img src="assets/screenshots/5-series.jpg" alt="TV Series Details" width="800">
+If the source doesn't support HTTP range requests, the downloader falls back to a single connection. Nothing you can do about that except pick a different quality or source. If it does support ranges, you should see `[16x]` in the status line.
</details>
+---
+
+## Contributing
+
+Contributions are welcome. If you're planning something bigger than a small fix, please open an issue first so we can talk it through.
+
+```bash
+git clone https://github.com/<your-username>/MovieBox-Tui.git
+cd MovieBox-Tui
+cargo build
+
+# Before opening a PR:
+cargo fmt --all
+cargo clippy --all-targets --all-features -- -D warnings
+```
+
+Commits follow [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, `docs:`, etc.). See [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide.
+
+---
+
+## Acknowledgements
+
+Built with [Ratatui](https://ratatui.rs), [crossterm](https://github.com/crossterm-rs/crossterm), [ratatui-image](https://github.com/benjajaja/ratatui-image), [tokio](https://tokio.rs), and [reqwest](https://github.com/seanmonstar/reqwest). Playback is powered by [mpv](https://mpv.io), [IINA](https://iina.io), and [VLC](https://www.videolan.org).
+
+---
+
## License
-Dual-licensed under MIT or Apache-2.0.
+Dual-licensed under [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE) at your option.
+
+---
+
+<div align="center">
+
+Made by [**@mesamirh**](https://github.com/mesamirh)
+
+<sub>Not affiliated with MovieBox or its operators.</sub>
+
+</div>
diff --git a/assets/screenshots/01-home.png b/assets/screenshots/01-home.png
new file mode 100644
index 0000000..efd3e78
Binary files /dev/null and b/assets/screenshots/01-home.png differ
diff --git a/assets/screenshots/02-search-results.png b/assets/screenshots/02-search-results.png
new file mode 100644
index 0000000..3a605f0
Binary files /dev/null and b/assets/screenshots/02-search-results.png differ
diff --git a/assets/screenshots/03-movie-details.png b/assets/screenshots/03-movie-details.png
new file mode 100644
index 0000000..4f9c30f
Binary files /dev/null and b/assets/screenshots/03-movie-details.png differ
diff --git a/assets/screenshots/04-series-details.png b/assets/screenshots/04-series-details.png
new file mode 100644
index 0000000..4424abb
Binary files /dev/null and b/assets/screenshots/04-series-details.png differ
diff --git a/assets/screenshots/05-discover-movies.png b/assets/screenshots/05-discover-movies.png
new file mode 100644
index 0000000..5e6bc9c
Binary files /dev/null and b/assets/screenshots/05-discover-movies.png differ
diff --git a/assets/screenshots/06-discover-series.png b/assets/screenshots/06-discover-series.png
new file mode 100644
index 0000000..ab37e08
Binary files /dev/null and b/assets/screenshots/06-discover-series.png differ
diff --git a/assets/screenshots/07-discover-anime.png b/assets/screenshots/07-discover-anime.png
new file mode 100644
index 0000000..42a285d
Binary files /dev/null and b/assets/screenshots/07-discover-anime.png differ
diff --git a/assets/screenshots/08-help.png b/assets/screenshots/08-help.png
new file mode 100644
index 0000000..179c1de
Binary files /dev/null and b/assets/screenshots/08-help.png differ
diff --git a/assets/screenshots/1-home.jpg b/assets/screenshots/1-home.jpg
deleted file mode 100644
index 52ab7af..0000000
Binary files a/assets/screenshots/1-home.jpg and /dev/null differ
diff --git a/assets/screenshots/2-search.jpg b/assets/screenshots/2-search.jpg
deleted file mode 100644
index f495b69..0000000
Binary files a/assets/screenshots/2-search.jpg and /dev/null differ
diff --git a/assets/screenshots/3-movie.jpg b/assets/screenshots/3-movie.jpg
deleted file mode 100644
index 32c179d..0000000
Binary files a/assets/screenshots/3-movie.jpg and /dev/null differ
diff --git a/assets/screenshots/4-streams.jpg b/assets/screenshots/4-streams.jpg
deleted file mode 100644
index dd95b8c..0000000
Binary files a/assets/screenshots/4-streams.jpg and /dev/null differ
diff --git a/assets/screenshots/5-series.jpg b/assets/screenshots/5-series.jpg
deleted file mode 100644
index bcec4e8..0000000
Binary files a/assets/screenshots/5-series.jpg and /dev/null differ
diff --git a/src/providers/moviebox/client.rs b/src/providers/moviebox/client.rs
index 607a0d4..7efe2d7 100644
--- a/src/providers/moviebox/client.rs
+++ b/src/providers/moviebox/client.rs
@@ -51,6 +51,9 @@ impl MovieBoxClient {
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(12))
.connect_timeout(std::time::Duration::from_secs(3))
+ .tcp_keepalive(std::time::Duration::from_secs(30))
+ .pool_idle_timeout(std::time::Duration::from_secs(90))
+ .pool_max_idle_per_host(4)
.build()
.expect("Failed to build reqwest client; TLS backend may be missing");
diff --git a/src/providers/moviebox/mod.rs b/src/providers/moviebox/mod.rs
index e6b59c4..4b16b3e 100644
--- a/src/providers/moviebox/mod.rs
+++ b/src/providers/moviebox/mod.rs
@@ -112,8 +112,15 @@ impl MovieBoxClient {
let sid = subject_id.to_string();
let r = res.to_string();
handles.push(tokio::spawn(async move {
- c.get_resources(&sid, season, episode, 1, Some(&r), 20)
- .await
+ match tokio::time::timeout(
+ std::time::Duration::from_secs(8),
+ c.get_resources(&sid, season, episode, 1, Some(&r), 20),
+ )
+ .await
+ {
+ Ok(res) => res,
+ Err(_) => Err(ScraperError::ApiStatus(408)),
+ }
}));
}
diff --git a/src/tui/app.rs b/src/tui/app.rs
index 29d9c11..3433799 100644
--- a/src/tui/app.rs
+++ b/src/tui/app.rs
@@ -29,7 +29,7 @@ pub fn clean_moviebox_title(raw_title: &str) -> String {
let is_season = suffix
.chars()
.all(|c| c.is_ascii_digit() || c == '-' || c == 'S');
- if is_season && suffix.chars().next().map_or(false, |c| c.is_ascii_digit()) {
+ if is_season && suffix.chars().next().is_some_and(|c| c.is_ascii_digit()) {
clean = clean[..s_idx].trim_end().to_string();
}
}
@@ -115,7 +115,8 @@ impl App {
match ratatui_image::picker::Picker::from_query_stdio() {
Ok(mut picker) => {
let size = picker.font_size();
- let fallback = format!("{:?}", size).contains("8") && format!("{:?}", size).contains("16");
+ let fallback =
+ format!("{:?}", size).contains("8") && format!("{:?}", size).contains("16");
let empty = format!("{:?}", size).contains("0");
if fallback || empty {
if let Ok(picker2) = ratatui_image::picker::Picker::from_query_stdio() {
@@ -123,7 +124,7 @@ impl App {
}
}
self.state.image_picker = Some(picker);
-
+
tokio::time::sleep(std::time::Duration::from_millis(30)).await;
while crossterm::event::poll(std::time::Duration::ZERO).unwrap_or(false) {
let _ = crossterm::event::read();
@@ -140,14 +141,11 @@ impl App {
let _init_sender = self.action_sender.clone();
let client_clone = self.client.clone();
tokio::spawn(async move {
-
match client_clone.init().await {
Ok(_) => {
let _ = _init_sender;
}
- Err(_e) => {
-
- }
+ Err(_e) => {}
}
});
@@ -275,12 +273,9 @@ impl App {
use crossterm::event::{KeyCode, KeyModifiers};
if key.modifiers.contains(KeyModifiers::CONTROL) {
- match key.code {
- KeyCode::Char('c') => {
- self.action_sender.send(Action::Quit).ok();
- return Some(());
- }
- _ => {}
+ if let KeyCode::Char('c') = key.code {
+ self.action_sender.send(Action::Quit).ok();
+ return Some(());
}
}
@@ -402,18 +397,38 @@ impl App {
self.action_sender.send(Action::CopyLink).ok();
}
KeyCode::Char('o') | KeyCode::Char('O') => {
- if let crate::tui::state::DetailsPane::Streams = self.state.details_pane {
- self.action_sender.send(Action::PlayStream(true)).ok();
+ if !self.state.subtitle_popup && !self.state.player_picker_popup {
+ if let crate::tui::state::DetailsPane::Streams =
+ self.state.details_pane
+ {
+ self.action_sender.send(Action::PlayStream(true)).ok();
+ }
}
}
KeyCode::Char('d') | KeyCode::Char('D') => {
- self.action_sender.send(Action::DownloadStream).ok();
+ if !self.state.subtitle_popup && !self.state.player_picker_popup {
+ self.action_sender.send(Action::DownloadStream).ok();
+ }
}
KeyCode::Char('R') => {
if let Some(id) = self.state.active_subject_id.clone() {
- let se = if self.state.available_seasons.is_empty() { 0 } else { self.state.selected_season };
- let ep = if self.state.available_seasons.is_empty() { 0 } else { self.state.selected_episode };
- self.action_sender.send(Action::FetchResources { subject_id: id, season: se, episode: ep }).ok();
+ let se = if self.state.available_seasons.is_empty() {
+ 0
+ } else {
+ self.state.selected_season
+ };
+ let ep = if self.state.available_seasons.is_empty() {
+ 0
+ } else {
+ self.state.selected_episode
+ };
+ self.action_sender
+ .send(Action::FetchResources {
+ subject_id: id,
+ season: se,
+ episode: ep,
+ })
+ .ok();
}
}
KeyCode::Char('?') => {
@@ -436,13 +451,17 @@ impl App {
self.action_sender.send(Action::MoveRight).ok();
}
KeyCode::Enter => {
- let open_with = key.modifiers.contains(crossterm::event::KeyModifiers::SHIFT);
+ let open_with = key
+ .modifiers
+ .contains(crossterm::event::KeyModifiers::SHIFT);
if self.state.subtitle_popup || self.state.player_picker_popup {
self.action_sender.send(Action::Submit).ok();
} else {
match self.state.details_pane {
crate::tui::state::DetailsPane::Streams => {
- self.action_sender.send(Action::PlayStream(open_with)).ok();
+ self.action_sender
+ .send(Action::PlayStream(open_with))
+ .ok();
}
crate::tui::state::DetailsPane::Seasons => {
self.action_sender.send(Action::MoveRight).ok();
@@ -669,7 +688,7 @@ impl App {
}
self.state.search_suggestions.clear();
self.state.suggest_index = None;
- self.state.status_message = format!("Loading discover tab...");
+ self.state.status_message = "Loading discover tab...".to_string();
self.state.status_timer = 150;
let client = self.client.clone();
@@ -1339,7 +1358,9 @@ impl App {
if let Some(player) = self.state.available_players.get(idx).copied() {
if let Some(link) = self.state.player_picker_link.take() {
let sub = self.state.player_picker_subtitle.take();
- self.action_sender.send(Action::LaunchPlayer(player, link, sub)).ok();
+ self.action_sender
+ .send(Action::LaunchPlayer(player, link, sub))
+ .ok();
}
}
return None;
@@ -1351,9 +1372,13 @@ impl App {
if let Some(link) = self.state.pending_play_link.take() {
let open_with = self.state.pending_open_with;
if open_with {
- self.action_sender.send(Action::ShowPlayerPicker(link, sub_url)).ok();
+ self.action_sender
+ .send(Action::ShowPlayerPicker(link, sub_url))
+ .ok();
} else {
- self.action_sender.send(Action::LaunchMpv(link, sub_url)).ok();
+ self.action_sender
+ .send(Action::LaunchMpv(link, sub_url))
+ .ok();
}
}
return None;
@@ -1415,21 +1440,27 @@ impl App {
let url = url.to_string();
let tx = self.action_sender.clone();
let id2 = id.clone();
+ let client = self.client.http_client().clone();
tokio::spawn(async move {
- let client = reqwest::Client::builder()
- .timeout(std::time::Duration::from_secs(5))
- .build()
- .unwrap_or_default();
if let Ok(resp) = client
.get(&url)
.header("User-Agent", "MovieBox-Tui/1.0")
.send()
.await
- && let Ok(bytes) = resp.bytes().await
- && let Ok(img) = image::load_from_memory(&bytes)
{
- tx.send(Action::PosterSuccess(id2, std::sync::Arc::new(img)))
- .ok();
+ if let Ok(bytes) = resp.bytes().await {
+ if let Ok(Ok(img)) = tokio::task::spawn_blocking(move || {
+ image::load_from_memory(&bytes)
+ })
+ .await
+ {
+ tx.send(Action::PosterSuccess(
+ id2,
+ std::sync::Arc::new(img),
+ ))
+ .ok();
+ }
+ }
}
});
}
@@ -1568,7 +1599,9 @@ impl App {
let link_clone = link.clone();
tokio::spawn(async move {
if let Ok(res) = client.get_ext_captions(&subject_id, &rid).await {
- sender.send(Action::ShowSubtitlePopup(link_clone, res, open_with)).ok();
+ sender
+ .send(Action::ShowSubtitlePopup(link_clone, res, open_with))
+ .ok();
} else {
if open_with {
sender.send(Action::ShowPlayerPicker(link_clone, None)).ok();
@@ -1579,7 +1612,9 @@ impl App {
});
} else {
if open_with {
- self.action_sender.send(Action::ShowPlayerPicker(link, None)).ok();
+ self.action_sender
+ .send(Action::ShowPlayerPicker(link, None))
+ .ok();
} else {
self.action_sender.send(Action::LaunchMpv(link, None)).ok();
}
@@ -1617,7 +1652,9 @@ impl App {
self.state.pending_open_with = open_with;
} else {
if open_with {
- self.action_sender.send(Action::ShowPlayerPicker(link, None)).ok();
+ self.action_sender
+ .send(Action::ShowPlayerPicker(link, None))
+ .ok();
} else {
self.action_sender.send(Action::LaunchMpv(link, None)).ok();
}
@@ -2393,7 +2430,7 @@ impl App {
use std::os::unix::process::CommandExt;
cmd.process_group(0);
}
-
+
if cmd.spawn().is_err() {
self.state.toast_message = Some("βœ— Failed to launch player".to_string());
self.state.toast_timer = 60;
@@ -2450,11 +2487,8 @@ impl App {
Screen::Details => {
super::screens::details::draw(frame, area, &mut self.state, &self.theme);
}
-
}
-
-
if self.state.show_help {
super::screens::help::draw(frame, area, &self.state, &self.theme);
}
@@ -2494,7 +2528,10 @@ impl App {
use ratatui::widgets::Paragraph;
- let inner_area = area.inner(ratatui::layout::Margin { vertical: 1, horizontal: 2 });
+ let inner_area = area.inner(ratatui::layout::Margin {
+ vertical: 1,
+ horizontal: 2,
+ });
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([Constraint::Length(1), Constraint::Min(0)])
diff --git a/src/tui/event.rs b/src/tui/event.rs
index bfb4b61..f751788 100644
--- a/src/tui/event.rs
+++ b/src/tui/event.rs
@@ -28,11 +28,12 @@ impl EventHandler {
Ok(CrosstermEvent::FocusGained) => {
let _ = event_sender.send(Action::FocusChange);
}
- Ok(CrosstermEvent::Resize(w, h)) => {
- if event_sender.send(Action::Resize(w, h)).is_err() {
- break;
- }
+ Ok(CrosstermEvent::Resize(w, h))
+ if event_sender.send(Action::Resize(w, h)).is_err() =>
+ {
+ break;
}
+ Ok(CrosstermEvent::Resize(_, _)) => {}
_ => {}
}
}
diff --git a/src/tui/screens/details.rs b/src/tui/screens/details.rs
index b8c967a..2117f64 100644
--- a/src/tui/screens/details.rs
+++ b/src/tui/screens/details.rs
@@ -449,9 +449,9 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
let pointer = if is_selected { "β–Œ " } else { " " };
let stream_style = if is_selected {
- theme.highlight.clone()
+ theme.highlight
} else {
- theme.text_dim.clone()
+ theme.text_dim
};
let stream_line = ratatui::text::Line::from(vec![
diff --git a/src/tui/screens/help.rs b/src/tui/screens/help.rs
index 945dda0..8667aa7 100644
--- a/src/tui/screens/help.rs
+++ b/src/tui/screens/help.rs
@@ -13,7 +13,7 @@ pub fn draw(frame: &mut Frame, area: Rect, _state: &AppState, theme: &Theme) {
theme.header.add_modifier(ratatui::style::Modifier::BOLD),
)]),
Line::from(vec![
- Span::styled(" [?] ", theme.header),
+ Span::styled(" [?] / [F1] ", theme.header),
Span::styled("Toggle Help Menu", theme.text),
]),
Line::from(vec![
@@ -46,6 +46,10 @@ pub fn draw(frame: &mut Frame, area: Rect, _state: &AppState, theme: &Theme) {
" Discover & Search",
theme.header.add_modifier(ratatui::style::Modifier::BOLD),
)]),
+ 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),
@@ -68,9 +72,13 @@ pub fn draw(frame: &mut Frame, area: Rect, _state: &AppState, theme: &Theme) {
Span::styled("Play Video in mpv", theme.text),
]),
Line::from(vec![
- Span::styled(" [⇧+Enter] ", theme.header),
+ Span::styled(" [o] ", theme.header),
Span::styled("Open Player Picker", theme.text),
]),
+ Line::from(vec![
+ Span::styled(" [R] ", theme.header),
+ Span::styled("Refresh Streams", theme.text),
+ ]),
Line::from(vec![
Span::styled(" [d] ", theme.header),
Span::styled("Download Video", theme.text),
diff --git a/src/tui/screens/home.rs b/src/tui/screens/home.rs
index eb87a65..2a4378c 100644
--- a/src/tui/screens/home.rs
+++ b/src/tui/screens/home.rs
@@ -316,7 +316,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
if is_selected {
let indicator = Paragraph::new(ratatui::text::Line::from(vec![
- ratatui::text::Span::styled("β–Œ ", theme.accent.clone()),
+ ratatui::text::Span::styled("β–Œ ", theme.accent),
]));
let v_layout = Layout::default()
@@ -425,8 +425,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
.or_else(|| meta.get("imdbRatingValue"))
.and_then(|v| v.as_str());
if let Some(r) = rating {
- info_spans
- .push(ratatui::text::Span::styled("β˜… ", theme.rating.clone()));
+ info_spans.push(ratatui::text::Span::styled("β˜… ", theme.rating));
info_spans.push(ratatui::text::Span::styled(r, theme.text));
info_spans.push(ratatui::text::Span::styled(" β€’ ", theme.text_dim));
}
diff --git a/src/tui/state.rs b/src/tui/state.rs
index 998e38c..9e5b2a4 100644
--- a/src/tui/state.rs
+++ b/src/tui/state.rs
@@ -166,17 +166,29 @@ impl Default for AppState {
available_players: {
let mut players = Vec::new();
if std::path::Path::new("/Applications/IINA.app").exists()
- || std::process::Command::new("which").arg("iina").output().map(|o| o.status.success()).unwrap_or(false)
+ || std::process::Command::new("which")
+ .arg("iina")
+ .output()
+ .map(|o| o.status.success())
+ .unwrap_or(false)
{
players.push(PlayerKind::Iina);
}
if std::path::Path::new("/Applications/mpv.app").exists()
- || std::process::Command::new("which").arg("mpv").output().map(|o| o.status.success()).unwrap_or(false)
+ || std::process::Command::new("which")
+ .arg("mpv")
+ .output()
+ .map(|o| o.status.success())
+ .unwrap_or(false)
{
players.push(PlayerKind::Mpv);
}
if std::path::Path::new("/Applications/VLC.app").exists()
- || std::process::Command::new("which").arg("vlc").output().map(|o| o.status.success()).unwrap_or(false)
+ || std::process::Command::new("which")
+ .arg("vlc")
+ .output()
+ .map(|o| o.status.success())
+ .unwrap_or(false)
{
players.push(PlayerKind::Vlc);
}