Skip to content

Commit

Permalink
fix issue with fallback play/pause detection on standard player
Browse files Browse the repository at this point in the history
  • Loading branch information
PKBeam committed May 5, 2024
1 parent 698ac00 commit 3190710
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AMWin-RichPresence/AppleMusicClientScraper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public void Refresh(object? source, ElapsedEventArgs? e) {
currentSong.IsPaused = playPauseButton.Name == "Play";

} else { // ... otherwise fallback to tracking song progress
var songProgressSlider = (isMiniPlayer ? amSongPanel.FindFirstChild("Scrubber") : amSongPanel.FindFirstChild("LCDScrubber"))?.Patterns.RangeValue.Pattern;
var songProgressSlider = (isMiniPlayer ? amSongPanel.FindFirstChild("Scrubber") : amSongPanel.FindFirstChild("LCD").FindFirstChild("LCDScrubber"))?.Patterns.RangeValue.Pattern;
var songProgress = songProgressSlider == null ? 0 : songProgressSlider.Value / songProgressSlider.Maximum;

currentSong.IsPaused = previousSongProgress != null && songProgress == previousSongProgress;
Expand Down

0 comments on commit 3190710

Please sign in to comment.