diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 18822b00..fba9e25e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -22,7 +22,7 @@ android { minSdk = 24 targetSdk = 35 versionCode = 24 - versionName = "2.1-beta05" + versionName = "2.1-beta06" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/com/skyd/anivu/ui/mpv/PlayerView.kt b/app/src/main/java/com/skyd/anivu/ui/mpv/PlayerView.kt index 7daed0be..af93e140 100644 --- a/app/src/main/java/com/skyd/anivu/ui/mpv/PlayerView.kt +++ b/app/src/main/java/com/skyd/anivu/ui/mpv/PlayerView.kt @@ -178,7 +178,9 @@ fun PlayerView( } LaunchedEffect(mediaLoaded) { if (uiState.needLoadLastPlayPosition && mediaLoaded && playState.duration > 0) { - dispatcher(PlayerIntent.TrySeekToLast(uri.toString(), playState.duration * 1000L)) + uri.resolveUri(context)?.let { mediaId -> + dispatcher(PlayerIntent.TrySeekToLast(mediaId, playState.duration * 1000L)) + } } } val dialogState by remember { @@ -455,10 +457,11 @@ fun PlayerView( } Lifecycle.Event.ON_DESTROY -> { - viewModel.updatePlayHistory( - uri.toString(), - playState.currentPosition * 1000L, - ) + uri.resolveUri(context)?.let { mediaId -> + viewModel.updatePlayHistory( + mediaId, playState.currentPosition * 1000L, + ) + } } else -> Unit