Fixes websocket subscription, date invalidation, & theme music (#616)

## Description
Makes sure the `ServerEventListener` and `DatePlayedInvalidationService`
are injected so that they run. This was broken in #538.

Also fixes the a delayed stopping of theme music

Also fixes for detecting a non-seamless refresh rate switch

### Related issues
Fixes #615
Fixes #568
This commit is contained in:
Ray 2026-01-01 22:19:36 -05:00 committed by GitHub
parent d15ffa13b8
commit 0958578082
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 29 additions and 22 deletions

View file

@ -95,13 +95,13 @@ class RefreshRateService
} catch (ex: InterruptedException) {
Timber.w(ex, "Exception waiting for refresh rate switch")
}
val targetRate = (targetMode.refreshRate * 100).roundToInt()
val targetRate = (targetMode.refreshRate * 1000).roundToInt()
val isSeamless =
targetRate == (display.mode.refreshRate * 100).roundToInt() ||
targetRate == (currentDisplayMode.refreshRate * 1000).roundToInt() ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
display.mode.alternativeRefreshRates
.map { (it * 100).roundToInt() }
.any { targetRate % it == 0 }
currentDisplayMode.alternativeRefreshRates
.map { (it * 1000).roundToInt() }
.any { it % targetRate == 0 }
} else {
false
}

View file

@ -104,7 +104,9 @@ class ThemeSongPlayer
}
fun stop() {
Timber.v("Stopping theme song")
player.stop()
if (player.isPlaying) {
Timber.v("Stopping theme song")
player.stop()
}
}
}