fix: properly pre-insert queued tracks before played track

This commit is contained in:
Lei Nelissen
2024-07-26 10:40:52 +02:00
parent b6431bf71d
commit 399340127d
3 changed files with 1 additions and 4 deletions

View File

@@ -65,8 +65,6 @@ export default function LyricsProgress({
}; };
}); });
console.log(progressAnimation.value);
// GUARD: Only show durations if they last for more than 5 seconds. // GUARD: Only show durations if they last for more than 5 seconds.
if (duration < 5e7) { if (duration < 5e7) {
return null; return null;

View File

@@ -40,7 +40,6 @@ export default async function() {
TrackPlayer.addEventListener(Event.PlaybackActiveTrackChanged, async (e) => { TrackPlayer.addEventListener(Event.PlaybackActiveTrackChanged, async (e) => {
// Retrieve the current settings from the Redux store // Retrieve the current settings from the Redux store
const settings = store.getState().settings; const settings = store.getState().settings;
console.log('TrackChanged', e?.track?.title);
// GUARD: Only report playback when the settings is enabled // GUARD: Only report playback when the settings is enabled
if (settings.enablePlaybackReporting && 'track' in e) { if (settings.enablePlaybackReporting && 'track' in e) {

View File

@@ -130,7 +130,7 @@ export default function usePlayTracks() {
// Then, we'll insert the "previous" tracks after the queue // Then, we'll insert the "previous" tracks after the queue
// has started playing. This ensures that these tracks won't // has started playing. This ensures that these tracks won't
// trigger any events on the track player. // trigger any events on the track player.
await TrackPlayer.add(before, options.playIndex); await TrackPlayer.add(before, 0);
} else { } else {
await TrackPlayer.add(newTracks); await TrackPlayer.add(newTracks);
if (play) await TrackPlayer.play(); if (play) await TrackPlayer.play();