mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-07-26 22:42:17 +00:00
refactor: reuse upstream segment categorization for auto-skip
This commit is contained in:
parent
02563ee494
commit
5a8fe85b67
2 changed files with 5 additions and 5 deletions
|
|
@ -23,12 +23,12 @@ import kotlinx.coroutines.launch
|
|||
import nuvio.composeapp.generated.resources.*
|
||||
import org.jetbrains.compose.resources.getString
|
||||
|
||||
/** Whether auto-skip is enabled for this segment's type. */
|
||||
/** Whether auto-skip is enabled for this segment's type (categorized by SkipIntroRepository). */
|
||||
internal fun PlayerSettingsUiState.autoSkips(interval: SkipInterval): Boolean =
|
||||
when (interval.type.lowercase()) {
|
||||
"intro", "op", "mixed-op" -> autoSkipIntroEnabled
|
||||
when (SkipIntroRepository.segmentCategory(interval.type)) {
|
||||
"opening" -> autoSkipIntroEnabled
|
||||
"recap" -> autoSkipRecapEnabled
|
||||
"outro", "ed", "mixed-ed", "credits" -> autoSkipOutroEnabled
|
||||
"ending" -> autoSkipOutroEnabled
|
||||
else -> false
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ object SkipIntroRepository {
|
|||
return chosen.values.toList()
|
||||
}
|
||||
|
||||
private fun segmentCategory(type: String): String? = when (type.lowercase()) {
|
||||
internal fun segmentCategory(type: String): String? = when (type.lowercase()) {
|
||||
"intro", "op", "mixed-op" -> "opening"
|
||||
"outro", "ed", "mixed-ed", "credits", "ending" -> "ending"
|
||||
"recap" -> "recap"
|
||||
|
|
|
|||
Loading…
Reference in a new issue