diff --git a/app/src/main/kotlin/app/vitune/android/ui/screens/player/Thumbnail.kt b/app/src/main/kotlin/app/vitune/android/ui/screens/player/Thumbnail.kt index 9c8a0d3a83..b97e561423 100644 --- a/app/src/main/kotlin/app/vitune/android/ui/screens/player/Thumbnail.kt +++ b/app/src/main/kotlin/app/vitune/android/ui/screens/player/Thumbnail.kt @@ -135,8 +135,7 @@ fun Thumbnail( binder?.player?.forceSeekToNext() }, onSwipeRight = { - binder?.player?.seekToDefaultPosition() - binder?.player?.forceSeekToPrevious() + binder?.player?.forceSeekToPrevious(seekToStart = false) } ), contentAlignment = Alignment.Center, diff --git a/app/src/main/kotlin/app/vitune/android/utils/Player.kt b/app/src/main/kotlin/app/vitune/android/utils/Player.kt index 2705c3f9d9..d89b2f3435 100644 --- a/app/src/main/kotlin/app/vitune/android/utils/Player.kt +++ b/app/src/main/kotlin/app/vitune/android/utils/Player.kt @@ -63,8 +63,10 @@ fun Player.forcePlayAtIndex( fun Player.forcePlayFromBeginning(items: List) = forcePlayAtIndex(items, 0) fun Player.forceSeekToPrevious( - hideExplicit: Boolean = AppearancePreferences.hideExplicit + hideExplicit: Boolean = AppearancePreferences.hideExplicit, + seekToStart: Boolean = true ): Unit = when { + seekToStart && currentPosition > maxSeekToPreviousPosition -> seekToPrevious() hideExplicit -> { if (mediaItemCount > 1) { var i = currentMediaItemIndex - 1 @@ -80,7 +82,6 @@ fun Player.forceSeekToPrevious( } hasPreviousMediaItem() -> seekToPreviousMediaItem() mediaItemCount > 0 -> seekTo(mediaItemCount - 1, C.TIME_UNSET) - currentPosition > maxSeekToPreviousPosition -> seekToPrevious() else -> {} }