fixes for introdb submit

This commit is contained in:
paregi12 2026-05-02 11:48:45 +05:30
parent 5c7253d21f
commit cf22743148
4 changed files with 19 additions and 4 deletions

View file

@ -21,6 +21,7 @@ import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Flag
import androidx.compose.material.icons.rounded.Forward10 import androidx.compose.material.icons.rounded.Forward10
import androidx.compose.material.icons.rounded.Lock import androidx.compose.material.icons.rounded.Lock
import androidx.compose.material.icons.rounded.LockOpen import androidx.compose.material.icons.rounded.LockOpen
@ -79,6 +80,7 @@ internal fun PlayerControlsShell(
onAudioClick: () -> Unit, onAudioClick: () -> Unit,
onSourcesClick: (() -> Unit)? = null, onSourcesClick: (() -> Unit)? = null,
onEpisodesClick: (() -> Unit)? = null, onEpisodesClick: (() -> Unit)? = null,
onSubmitIntroClick: (() -> Unit)? = null,
onScrubChange: (Long) -> Unit, onScrubChange: (Long) -> Unit,
onScrubFinished: (Long) -> Unit, onScrubFinished: (Long) -> Unit,
horizontalSafePadding: androidx.compose.ui.unit.Dp, horizontalSafePadding: androidx.compose.ui.unit.Dp,
@ -421,6 +423,7 @@ private fun ProgressControls(
onAudioClick: () -> Unit, onAudioClick: () -> Unit,
onSourcesClick: (() -> Unit)? = null, onSourcesClick: (() -> Unit)? = null,
onEpisodesClick: (() -> Unit)? = null, onEpisodesClick: (() -> Unit)? = null,
onSubmitIntroClick: (() -> Unit)? = null,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
val durationMs = playbackSnapshot.durationMs.coerceAtLeast(1L) val durationMs = playbackSnapshot.durationMs.coerceAtLeast(1L)

View file

@ -1847,11 +1847,17 @@ fun PlayerScreen(
) )
} }
if (showSubmitIntroModal && activeSeasonNumber != null && activeEpisodeNumber != null && activeImdbId != null) { val season = activeSeasonNumber
val episode = activeEpisodeNumber
val imdbId = activeVideoId?.split(":")?.firstOrNull()?.takeIf { it.startsWith("tt") }
?: parentMetaId.takeIf { it.startsWith("tt") }
?: metaUiState.meta?.id?.takeIf { it.startsWith("tt") }
if (showSubmitIntroModal && season != null && episode != null && !imdbId.isNullOrBlank()) {
com.nuvio.app.features.player.skip.SubmitIntroDialog( com.nuvio.app.features.player.skip.SubmitIntroDialog(
imdbId = activeImdbId, imdbId = imdbId,
season = activeSeasonNumber, season = season,
episode = activeEpisodeNumber, episode = episode,
currentTimeSec = (displayedPositionMs / 1000.0), currentTimeSec = (displayedPositionMs / 1000.0),
onDismiss = { showSubmitIntroModal = false }, onDismiss = { showSubmitIntroModal = false },
) )

View file

@ -32,6 +32,8 @@ data class PlayerSettingsUiState(
val skipIntroEnabled: Boolean = true, val skipIntroEnabled: Boolean = true,
val animeSkipEnabled: Boolean = false, val animeSkipEnabled: Boolean = false,
val animeSkipClientId: String = "", val animeSkipClientId: String = "",
val introDbApiKey: String = "",
val introSubmitEnabled: Boolean = false,
val streamAutoPlayNextEpisodeEnabled: Boolean = false, val streamAutoPlayNextEpisodeEnabled: Boolean = false,
val streamAutoPlayPreferBingeGroup: Boolean = true, val streamAutoPlayPreferBingeGroup: Boolean = true,
val nextEpisodeThresholdMode: NextEpisodeThresholdMode = NextEpisodeThresholdMode.PERCENTAGE, val nextEpisodeThresholdMode: NextEpisodeThresholdMode = NextEpisodeThresholdMode.PERCENTAGE,

View file

@ -36,6 +36,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@ -58,6 +59,7 @@ import com.nuvio.app.features.plugins.PluginRepository
import com.nuvio.app.features.streams.StreamAutoPlayMode import com.nuvio.app.features.streams.StreamAutoPlayMode
import com.nuvio.app.features.streams.StreamAutoPlaySource import com.nuvio.app.features.streams.StreamAutoPlaySource
import com.nuvio.app.isIos import com.nuvio.app.isIos
import kotlinx.coroutines.launch
import nuvio.composeapp.generated.resources.* import nuvio.composeapp.generated.resources.*
import org.jetbrains.compose.resources.StringResource import org.jetbrains.compose.resources.StringResource
import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.resources.stringResource
@ -2159,3 +2161,5 @@ private fun libassRenderTypeRes(renderType: String): StringResource = when (rend
@Composable @Composable
private fun libassRenderTypeLabel(renderType: String): String = stringResource(libassRenderTypeRes(renderType)) private fun libassRenderTypeLabel(renderType: String): String = stringResource(libassRenderTypeRes(renderType))
): String = stringResource(libassRenderTypeRes(renderType))
pe))