diff --git a/app/src/main/kotlin/org/grakovne/lissen/playback/service/PlaybackSynchronizationService.kt b/app/src/main/kotlin/org/grakovne/lissen/playback/service/PlaybackSynchronizationService.kt index 31aa6f79..bf7bda5b 100644 --- a/app/src/main/kotlin/org/grakovne/lissen/playback/service/PlaybackSynchronizationService.kt +++ b/app/src/main/kotlin/org/grakovne/lissen/playback/service/PlaybackSynchronizationService.kt @@ -105,6 +105,11 @@ class PlaybackSynchronizationService try { val currentIndex = calculateChapterIndex(currentItem, overallProgress.currentTotalTime) + if (currentIndex > FIRST_CHAPTER && overallProgress.currentTotalTime == NO_PROGRESS) { + Timber.d("Don't sync currentTotalTime of 0.0 if chapter is not first") + return@launch + } + if (playbackSession == null || playbackSession?.itemId != currentItem.id || currentIndex != currentChapterIndex || @@ -183,6 +188,8 @@ class PlaybackSynchronizationService private const val SHORT_SYNC_WINDOW = SYNC_INTERVAL_LONG * 2 - 1 private const val SYNC_INTERVAL_SHORT = 5_000L + private const val FIRST_CHAPTER = 0 + private const val NO_PROGRESS = 0.0 private val syncEvents = listOf(