Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
fix: update player executables to use .exe extension on Windows for mpv and vlc
Samir Hossains4880e821f9ad
diff --git a/src/tui/player.rs b/src/tui/player.rsindex e76675f..0c04124 100644--- a/src/tui/player.rs+++ b/src/tui/player.rs@@ -51,7 +51,8 @@ fn mpv_command(headers: &[(String, String)],iina: bool,) -> Command {- let executable = mpv_executable().unwrap_or_else(|| "mpv".into());+ let fallback = if cfg!(target_os = "windows") { "mpv.exe" } else { "mpv" };+ let executable = mpv_executable().unwrap_or_else(|| fallback.into());let mut command = Command::new(executable);let prefix = if iina { "--mpv-" } else { "--" };@@ -95,7 +96,8 @@ fn iina_command(url: &str, subtitle: Option<&str>, headers: &[(String, String)])}fn vlc_command(url: &str, subtitle: Option<&str>, headers: &[(String, String)]) -> Command {- let executable = vlc_executable().unwrap_or_else(|| "vlc".into());+ let fallback = if cfg!(target_os = "windows") { "vlc.exe" } else { "vlc" };+ let executable = vlc_executable().unwrap_or_else(|| fallback.into());let mut command = Command::new(executable);command.arg("--width=960").arg("--height=540").arg(url);@@ -114,11 +116,13 @@ fn vlc_command(url: &str, subtitle: Option<&str>, headers: &[(String, String)])}fn mpv_executable() -> Option<String> {- first_executable(&[MPV_WINDOWS, MPV_MACOS], "mpv")+ let fallback = if cfg!(target_os = "windows") { "mpv.exe" } else { "mpv" };+ first_executable(&[MPV_WINDOWS, MPV_MACOS], fallback)}fn vlc_executable() -> Option<String> {- first_executable(&[VLC_WINDOWS, VLC_WINDOWS_X86, VLC_MACOS], "vlc")+ let fallback = if cfg!(target_os = "windows") { "vlc.exe" } else { "vlc" };+ first_executable(&[VLC_WINDOWS, VLC_WINDOWS_X86, VLC_MACOS], fallback)}fn first_executable(paths: &[&str], fallback: &str) -> Option<String> {