aboutsummaryrefslogtreecommitdiffstats
path: root/src/daemon.rs
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2026-05-10 00:29:01 +0200
committersalmonik <raisersoft@proton.me>2026-05-10 00:29:01 +0200
commit69172d7abe17d56b68a97465344467d8c34482b6 (patch)
tree2420fc37047441a9c81c7b7a221e84842a3f9e4e /src/daemon.rs
parentFix shuffle restore - track played tracks via shuffled_indices, not position (diff)
downloadrsplayer-69172d7abe17d56b68a97465344467d8c34482b6.tar.gz
rsplayer-69172d7abe17d56b68a97465344467d8c34482b6.zip
Fix queue display returning nothing - removed daemon pager, return full output instead. Increase pre-buffer to 100 packets.
Diffstat (limited to 'src/daemon.rs')
-rw-r--r--src/daemon.rs25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/daemon.rs b/src/daemon.rs
index 7488fc2..b79e67a 100644
--- a/src/daemon.rs
+++ b/src/daemon.rs
@@ -454,7 +454,10 @@ fn process_command(
454 for file in &files { 454 for file in &files {
455 q.add_track(file.clone()); 455 q.add_track(file.clone());
456 } 456 }
457 if was_empty && !was_playing && let Some(track) = q.current() { 457 if was_empty
458 && !was_playing
459 && let Some(track) = q.current()
460 {
458 audio.play(track.path.clone()); 461 audio.play(track.path.clone());
459 notification::notify_track(track); 462 notification::notify_track(track);
460 } 463 }
@@ -519,24 +522,8 @@ fn process_command(
519 } 522 }
520 } 523 }
521 } 524 }
522 // Use pager if queue is longer than terminal height 525 // Always return full output - client can pipe to pager if needed
523 let terminal_rows = terminal_size::terminal_size() 526 output
524 .map(|(w, _)| w.0 as usize)
525 .unwrap_or(24);
526 if output.lines().count() > terminal_rows {
527 use std::process::{Command, Stdio};
528 let pager = Command::new("less").arg("-R").stdin(Stdio::piped()).spawn();
529 if let Ok(mut child) = pager {
530 use std::io::Write;
531 let _ = child.stdin.as_mut().unwrap().write_all(output.as_bytes());
532 let _ = child.wait();
533 "".to_string()
534 } else {
535 output
536 }
537 } else {
538 output
539 }
540 } 527 }
541 } else { 528 } else {
542 "Error accessing queue\n".to_string() 529 "Error accessing queue\n".to_string()