Skip to content

Commit

Permalink
默认启动自动跳过 OP ED, close #893
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Sep 5, 2024
1 parent bcd67af commit 339fa3b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient
import me.him188.ani.app.platform.currentPlatform
import me.him188.ani.app.platform.isMobile

@Immutable
enum class FullscreenSwitchMode {
Expand Down Expand Up @@ -57,7 +55,7 @@ data class VideoScaffoldConfig(
/**
* 跳过 OP 和 ED
*/
val autoSkipOpEdExperimental: Boolean = false,
val autoSkipOpEd: Boolean = true,
@Suppress("PropertyName") @Transient val _placeholder: Int = 0,
) {
companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,11 @@ private fun SettingsScope.PlayerGroup(
if (currentPlatform.isDesktop()) {
HorizontalDividerItem()
SwitchItem(
checked = config.autoSkipOpEdExperimental,
checked = config.autoSkipOpEd,
onCheckedChange = {
videoScaffoldConfig.update(config.copy(autoSkipOpEdExperimental = it))
videoScaffoldConfig.update(config.copy(autoSkipOpEd = it))
},
title = { Text("自动跳过 OP 和 ED") },
description = { Text("实验性功能") },
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ private class EpisodeViewModelImpl(
// 跳过 OP 和 ED
launchInBackground {
settingsRepository.videoScaffoldConfig.flow
.map { it.autoSkipOpEdExperimental }
.map { it.autoSkipOpEd }
.distinctUntilChanged()
.debounce(1000)
.collectLatest { enabled ->
Expand Down

0 comments on commit 339fa3b

Please # to comment.