Skip to content

Commit 9f3d67c

Browse files
committed
Reproducing Spotify behaviour
1 parent bdc9279 commit 9f3d67c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • core/src/main/java/xyz/gianlu/librespot/player

core/src/main/java/xyz/gianlu/librespot/player/Player.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class Player implements FrameListener, TrackHandler.Listener {
2323
private final CacheManager cacheManager;
2424
private TrackHandler trackHandler;
2525
private TrackHandler preloadTrackHandler;
26-
private long shuffleSeed;
26+
private long shuffleSeed = 0;
2727

2828
public Player(@NotNull PlayerConfiguration conf, @NotNull CacheManager.CacheConfiguration cacheConfiguration, @NotNull Session session) {
2929
this.conf = conf;
@@ -235,6 +235,7 @@ private void updatedTracks(@NotNull Spirc.Frame frame) {
235235
state.setContextUri(frame.getState().getContextUri());
236236
state.setRepeat(frame.getState().getRepeat());
237237
state.setShuffle(frame.getState().getShuffle());
238+
if (state.getShuffle()) shuffleTracks();
238239
}
239240

240241
@Override

0 commit comments

Comments
 (0)