From b2529a830e723770295efd4cc33fb485c35c4d40 Mon Sep 17 00:00:00 2001 From: casey langen Date: Fri, 22 Jul 2022 15:18:28 -0700 Subject: [PATCH] Don't schedule notification time updates if we're not actively playing. --- .../musikcube/remote/service/system/SystemService.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/service/system/SystemService.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/service/system/SystemService.kt index ea74d2bb1..18b17f2e3 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/service/system/SystemService.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/service/system/SystemService.kt @@ -353,13 +353,14 @@ class SystemService : Service() { override fun run() { playback?.let { pb -> when (pb.state) { - PlaybackState.Playing, - PlaybackState.Buffering, - PlaybackState.Paused -> { + PlaybackState.Playing -> { updateNotificationAndSessionDebouncer.call() scheduleNotificationTimeUpdate() } - PlaybackState.Stopped -> Unit + PlaybackState.Buffering, + PlaybackState.Paused, + PlaybackState.Stopped -> { + } } } }