File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed
java/de/labystudio/spotifyapi/platform/windows
resources/natives/windows-x64 Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ plugins {
44}
55
66group ' de.labystudio'
7- version ' 1.4.0 '
7+ version ' 1.4.3 '
88
99compileJava {
1010 sourceCompatibility = ' 1.8'
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public class WinSpotifyAPI extends AbstractTickSpotifyAPI {
2424
2525 private Track currentTrack ;
2626 private int currentPosition = -1 ;
27+ private boolean hasTrackPosition = false ;
2728 private boolean isPlaying ;
2829
2930 private long lastTimePositionUpdated ;
@@ -102,8 +103,11 @@ protected void onTick() {
102103 this .listeners .forEach (listener -> listener .onPositionChanged (this .currentPosition ));
103104 }
104105 }
106+
107+ this .hasTrackPosition = true ;
105108 } else {
106109 this .currentPosition = -1 ;
110+ this .hasTrackPosition = false ;
107111 this .lastTimePositionUpdated = System .currentTimeMillis ();
108112 }
109113
@@ -142,9 +146,7 @@ public boolean hasPosition() {
142146 if (!this .isConnected ()) {
143147 return false ;
144148 }
145-
146- PlaybackAccessor playback = this .process .getMainPlaybackAccessor ();
147- return playback .hasTrackPosition ();
149+ return this .hasTrackPosition ;
148150 }
149151
150152 @ Override
Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ default boolean hasTrackLength() {
1616 }
1717
1818 default boolean hasTrackPosition () {
19- return this .getPosition () >= 0 && (! this .hasTrackLength () || this .getPosition () <= this .getLength () );
19+ return this .getPosition () >= 0 && this .hasTrackLength () && this .getPosition () <= this .getLength ();
2020 }
2121}
You can’t perform that action at this time.
0 commit comments