Rename repeat options to Disabled, Track, and Playlist

Change track and playlist to repeat current track indefinitely.
This commit is contained in:
norepro 2025-11-27 20:43:40 -08:00
parent ff97fa2f62
commit b559de8fc5
4 changed files with 33 additions and 52 deletions

View file

@ -60,12 +60,10 @@ impl MprisState {
}
fn loop_status(&self) -> LoopStatus {
if self.will_repeat {
// TODO: Our choice is between Track and Playlist. Track is the best match for current repeat behavior,
// but this may change when we implement mpris playlists.
LoopStatus::Track
} else {
LoopStatus::None
match self.repeat_state {
RepeatState::Disabled => LoopStatus::None,
RepeatState::Playlist => LoopStatus::Playlist,
RepeatState::Track => LoopStatus::Track,
}
}
}
@ -210,11 +208,10 @@ impl PlayerInterface for Player {
async fn set_loop_status(&self, loop_status: LoopStatus) -> Result<()> {
log::info!("SetLoopStatus({})", loop_status);
let repeat_state = if loop_status == LoopStatus::None {
RepeatState::Disabled
} else {
// TODO: This may change when we implement mpris playlists.
RepeatState::Always
let repeat_state = match loop_status {
LoopStatus::None => RepeatState::Disabled,
LoopStatus::Playlist => RepeatState::Playlist,
LoopStatus::Track => RepeatState::Track,
};
self.message(Message::RepeatToggled(repeat_state)).await?;
Ok(())