Skip to content

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

fix(moviebox): prioritize original and english audio tracks by default

Samir Hossains89f473557e5a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 32ff8bb..57dc691 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -39,6 +39,9 @@
- Curated `/browse` views into 4 categorized shelves (Popular, Top Rated, Trending, Most Watched) with proper filtering.
### Fixed
+- **Default Audio Track Prioritization (Original / English)**:
+ - Fixed movie and series details defaulting to regional Hindi dubs on MovieBox by prioritizing `Original` and `English` audio tracks over localized search result subject IDs.
+ - Preserved explicit user language selections when intentionally switching between dubs.
- **Home Landing Header & Footer Persistence**:
- Fixed ASCII logo header and shortcut footer disappearing into a blank screen when clearing history or viewing empty search states by removing fragile tick-based animation gates.
- Ensured the landing screen renders the logo, version, centered search bar, and footer shortcuts immediately on every frame.
diff --git a/src/tui/app/requests.rs b/src/tui/app/requests.rs
index f83d7ab..4a39a98 100644
--- a/src/tui/app/requests.rs
+++ b/src/tui/app/requests.rs
@@ -1058,12 +1058,7 @@ impl App {
self.state.episode_list_state.select(Some(ep_idx));
if let Some(dubs) = payload.get("dubs").and_then(|d| d.as_array()) {
- let matching_idx = dubs.iter().position(|dub| {
- dub.get("subjectId").and_then(crate::tui::state::subject_id)
- == Some(id.clone())
- });
-
- let fallback_idx = || {
+ let find_by_pattern = |patterns: &[&str]| {
dubs.iter().position(|dub| {
let labels = [
dub.get("title").and_then(|v| v.as_str()),
@@ -1073,13 +1068,23 @@ impl App {
];
let label = labels.into_iter().flatten().collect::<Vec<_>>().join(" ");
let lower = label.to_ascii_lowercase();
- lower.contains("original")
- || lower.contains("english")
- || lower.contains("sub")
+ patterns.iter().any(|pat| lower.contains(pat))
})
};
- let preferred_idx = matching_idx.or_else(fallback_idx).unwrap_or(0);
+ let preferred_idx = if self.state.language_chosen {
+ dubs.iter()
+ .position(|dub| {
+ dub.get("subjectId").and_then(crate::tui::state::subject_id)
+ == Some(id.clone())
+ })
+ .unwrap_or(0)
+ } else {
+ find_by_pattern(&["original", "orig"])
+ .or_else(|| find_by_pattern(&["english", "eng"]))
+ .unwrap_or(0)
+ };
+
self.state.language_list_state.select(Some(preferred_idx));
} else {
self.state.language_list_state.select(Some(0));