Fix incorrect offset when turning off shuffle
CI checks / stable / fmt (push) Successful in 4s Details

This commit is contained in:
Hans Mündelein 2023-06-14 11:15:42 +02:00
parent f8a77ee6ed
commit 6db11131c0
Signed by: hans
GPG Key ID: BA7B55E984CE74F4
3 changed files with 11 additions and 0 deletions

View File

@ -58,7 +58,13 @@ impl QueueManager {
pub fn shuffle_off(&mut self) {
self.shuffle = false;
let pos = self.current_position();
self.current_offset = pos;
self.play_order = (0..self.tracks.len()).collect();
debug!(
"offset: {}, order: {:?}",
self.current_offset, self.play_order
);
}
pub fn shuffle_all(&mut self) {

View File

@ -513,6 +513,7 @@ impl Playback {
#[instrument(skip(self))]
async fn flatten_node(&self, uuid: &str) -> Vec<Track> {
debug!("flattening node");
let tx = self.provider_tx.clone();
let (result_tx, result_rx) = flume::bounded(1);
let span = debug_span!("prov-chan");
@ -555,6 +556,7 @@ impl Playback {
#[instrument(skip(self))]
async fn get_urls_for_track(&self, uuid: &str) -> Result<Vec<String>, ProviderError> {
debug!("getting urls for track");
let tx = self.provider_tx.clone();
let (result_tx, result_rx) = flume::bounded(1);
let span = tracing::trace_span!("prov-chan");
@ -575,6 +577,7 @@ impl Playback {
#[instrument(skip(self))]
async fn play_or_stop(&self, track: Option<Track>) {
debug!("play or stop");
if let Some(track) = track {
let mut uuid = track.uuid.clone();
let urls = loop {
@ -621,6 +624,7 @@ impl Playback {
#[instrument(skip(self))]
async fn play(&self, track: Option<Track>) {
debug!("play");
if let Some(track) = track {
let mut uuid = track.uuid.clone();
let urls = loop {

View File

@ -132,6 +132,7 @@ impl ProviderClient for ProviderOrchestrator {
}
#[instrument(skip(self))]
async fn get_urls_for_track(&self, track_uuid: &str) -> Result<Vec<String>, ProviderError> {
debug!("get_urls_for_track");
self.tidal_client
.get_urls_for_track(track_uuid)
.in_current_span()