Skip to main content

spawn_autoqueue

Function spawn_autoqueue 

Source
pub fn spawn_autoqueue(
    state: Arc<SharedPlayerState>,
    tx: Sender<PlayerCommand>,
    db_path: PathBuf,
)
Expand description

Keep the queue topped up while radio mode is on.

Radio mode is a flag on SharedPlayerState, and for a long time only the TUI acted on it — so any other client could switch it on and nothing would happen. Owning the loop here means every front end gets the same behaviour instead of reimplementing it, and there is one place to fix when it is wrong.

Runs on its own thread and exits when the player goes away.