Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #84 from tsirysndr/fix/cli-tui

cli: display tui only with 'start' or 'tui' subcommand

authored by

Tsiry Sandratraina and committed by
GitHub
b007d59b 039d7204

+8 -6
+1 -1
cli/src/cmd/scan.rs
··· 10 10 11 11 pub async fn scan(path: Option<String>) -> Result<(), Error> { 12 12 install_rockboxd()?; 13 - let handle = thread::spawn(|| match start() { 13 + let handle = thread::spawn(|| match start(false) { 14 14 Ok(_) => {} 15 15 Err(e) => { 16 16 eprintln!("Failed to start Rockbox server: {}", e);
+4 -2
cli/src/cmd/start.rs
··· 3 3 use anyhow::Error; 4 4 use rockbox::{install_rockboxd, wait_for_rockboxd}; 5 5 6 - pub fn start() -> Result<(), Error> { 6 + pub fn start(with_ui: bool) -> Result<(), Error> { 7 7 let video_driver = std::env::var("SDL_VIDEODRIVER").unwrap_or_else(|_| "dummy".to_string()); 8 8 9 9 let port = env::var("ROCKBOX_PORT").unwrap_or_else(|_| "6061".to_string()); ··· 13 13 14 14 // try to connect to mpd_port to see if mpd server is already running 15 15 if wait_for_rockboxd(mpd_port.parse()?, Some(1)).is_ok() { 16 - rmpc::main_tui()?; 16 + if with_ui { 17 + rmpc::main_tui()?; 18 + } 17 19 return Ok(()); 18 20 } 19 21
+1 -1
cli/src/cmd/webui.rs
··· 11 11 let port = env::var("ROCKBOX_UI_PORT").unwrap_or_else(|_| "6062".to_string()); 12 12 install_rockboxd()?; 13 13 14 - let handle = thread::spawn(|| match start() { 14 + let handle = thread::spawn(|| match start(false) { 15 15 Ok(_) => {} 16 16 Err(e) => { 17 17 eprintln!("Failed to start Rockbox server: {}", e);
+2 -2
cli/src/main.rs
··· 83 83 community(); 84 84 } 85 85 Some(("start", _)) => { 86 - start()?; 86 + start(true)?; 87 87 } 88 88 Some(("webui", _)) => { 89 89 webui()?; ··· 95 95 rmpc::main_tui()?; 96 96 } 97 97 _ => { 98 - start()?; 98 + start(true)?; 99 99 } 100 100 } 101 101 Ok(())