Skip to content

Commit 64267b2

Browse files
committed
improve address search & improve error handling, version 1.1.1
1 parent ae2ceb9 commit 64267b2

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repositories {
2323
}
2424
2525
dependencies {
26-
implementation 'com.github.LabyStudio:java-spotify-api:1.1.0:all'
26+
implementation 'com.github.LabyStudio:java-spotify-api:1.1.1:all'
2727
}
2828
```
2929

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group 'de.labystudio'
7-
version '1.1.0'
7+
version '1.1.1'
88

99
compileJava {
1010
sourceCompatibility = '1.8'

src/main/java/de/labystudio/spotifyapi/platform/windows/WinSpotifyAPI.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ protected void onTick() {
4848

4949
// Update playback status and check if it is valid
5050
if (!playback.update() || !this.process.isTrackIdValid(trackId)) {
51+
this.positionKnown = false;
52+
this.currentPosition = -1;
5153
throw new IllegalStateException("Could not update playback");
5254
}
5355

src/main/java/de/labystudio/spotifyapi/platform/windows/api/spotify/SpotifyProcess.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ public SpotifyProcess() {
3939
this.addressTrackId = this.findAddressOfText(
4040
this.maxContentAddress / 2,
4141
"spotify:track:",
42-
(address, index) -> this.hasBytes(address + 1028, 0xDC, 0xA1)
42+
(address, index) -> this.hasBytes(
43+
address + 37,
44+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
45+
)
4346
);
4447
if (this.addressTrackId == -1 || !this.isTrackIdValid(this.getTrackId())) {
4548
throw new IllegalStateException("Could not find track id in memory");

0 commit comments

Comments
 (0)