Skip to content

StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.

Add localized strings for Stalker catalog setup in multiple languages

David Nashashad3078f9b573
diff --git a/data/src/main/java/com/streamvault/data/local/dao/ProviderSnapshotDao.kt b/data/src/main/java/com/streamvault/data/local/dao/ProviderSnapshotDao.kt
index 92bd3eb6..8efb2916 100644
--- a/data/src/main/java/com/streamvault/data/local/dao/ProviderSnapshotDao.kt
+++ b/data/src/main/java/com/streamvault/data/local/dao/ProviderSnapshotDao.kt
@@ -16,6 +16,23 @@ abstract class ProviderSnapshotDao {
@Query("SELECT * FROM provider_configs WHERE provider_id = :providerId LIMIT 1")
abstract suspend fun getConfig(providerId: Long): ProviderConfigEntity?
+ @Query(
+ """
+ UPDATE provider_configs
+ SET encrypted_config_json = :replacementJson, updated_at = :updatedAt
+ WHERE provider_id = :providerId
+ AND configuration_generation = :configurationGeneration
+ AND encrypted_config_json = :expectedJson
+ """
+ )
+ abstract suspend fun rekeyConfigIfUnchanged(
+ providerId: Long,
+ configurationGeneration: Long,
+ expectedJson: String,
+ replacementJson: String,
+ updatedAt: Long
+ ): Int
+
@Query("SELECT * FROM provider_configs WHERE provider_id = :providerId LIMIT 1")
abstract fun getConfigSync(providerId: Long): ProviderConfigEntity?
diff --git a/data/src/main/java/com/streamvault/data/provider/ProviderConfigurationCodec.kt b/data/src/main/java/com/streamvault/data/provider/ProviderConfigurationCodec.kt
index 710de389..8596d2f6 100644
--- a/data/src/main/java/com/streamvault/data/provider/ProviderConfigurationCodec.kt
+++ b/data/src/main/java/com/streamvault/data/provider/ProviderConfigurationCodec.kt
@@ -19,12 +19,50 @@ class ProviderConfigurationCodec @Inject constructor(
private val gson: Gson,
private val credentialCrypto: CredentialCrypto
) {
+ internal data class MigrationDecodeResult(
+ val configuration: ProviderConfiguration,
+ val requiresReencryption: Boolean
+ )
+
+ internal data class MigrationEncodeResult(
+ val payload: String,
+ val usesPreferredKey: Boolean
+ )
+
fun encode(configuration: ProviderConfiguration): String =
encodeProviderConfiguration(gson, credentialCrypto, configuration)
+ internal fun encodeForKeyMigration(configuration: ProviderConfiguration): MigrationEncodeResult {
+ var usesPreferredKey = true
+ fun encrypt(value: String): String {
+ val result = credentialCrypto.encryptWithKeyMigration(value)
+ usesPreferredKey = usesPreferredKey && result.usesPreferredKey
+ return result.encryptedValue
+ }
+ val encrypted = when (configuration) {
+ is XtreamConfig -> configuration.copy(password = encrypt(configuration.password))
+ is M3uConfig -> configuration
+ is StalkerConfig -> configuration.copy(password = encrypt(configuration.password))
+ is JellyfinConfig -> configuration.copy(credential = encrypt(configuration.credential))
+ }
+ return MigrationEncodeResult(gson.toJson(encrypted), usesPreferredKey)
+ }
+
fun decode(type: ProviderType, payload: String): ProviderConfiguration =
decodeProviderConfigurationCompat(gson, credentialCrypto, type, payload)
+ internal fun decodeForKeyMigration(type: ProviderType, payload: String): MigrationDecodeResult {
+ var requiresReencryption = false
+ val configuration = decodeProviderConfigurationCompat(
+ gson = gson,
+ credentialCrypto = credentialCrypto,
+ type = type,
+ payload = payload,
+ onCredentialReencrypted = { requiresReencryption = true }
+ )
+ return MigrationDecodeResult(configuration, requiresReencryption)
+ }
+
/**
* Decode provider metadata for public projections without asking Android Keystore to open
* credentials that the projection will immediately discard.
diff --git a/data/src/main/java/com/streamvault/data/provider/ProviderConfigurationMigrationCompat.kt b/data/src/main/java/com/streamvault/data/provider/ProviderConfigurationMigrationCompat.kt
index a8e63d0d..a4e5fbe3 100644
--- a/data/src/main/java/com/streamvault/data/provider/ProviderConfigurationMigrationCompat.kt
+++ b/data/src/main/java/com/streamvault/data/provider/ProviderConfigurationMigrationCompat.kt
@@ -28,7 +28,8 @@ internal fun decodeProviderConfigurationCompat(
credentialCrypto: CredentialCrypto,
type: ProviderType,
payload: String,
- decryptCredentials: Boolean = true
+ decryptCredentials: Boolean = true,
+ onCredentialReencrypted: (() -> Unit)? = null
): ProviderConfiguration {
val payloadHasType = gson.fromJson(payload, Map::class.java)?.containsKey("type") == true
val decoded = when (type) {
@@ -53,10 +54,19 @@ internal fun decodeProviderConfigurationCompat(
if (!decryptCredentials) return normalized
+ fun decryptCredential(encryptedValue: String): String {
+ if (onCredentialReencrypted == null) {
+ return credentialCrypto.decryptIfNeeded(encryptedValue)
+ }
+ val result = credentialCrypto.decryptWithKeyMigration(encryptedValue)
+ if (result.requiresReencryption) onCredentialReencrypted()
+ return result.cleartext
+ }
+
return when (normalized) {
- is XtreamConfig -> normalized.copy(password = credentialCrypto.decryptIfNeeded(normalized.password))
+ is XtreamConfig -> normalized.copy(password = decryptCredential(normalized.password))
is M3uConfig -> normalized
- is StalkerConfig -> normalized.copy(password = credentialCrypto.decryptIfNeeded(normalized.password))
- is JellyfinConfig -> normalized.copy(credential = credentialCrypto.decryptIfNeeded(normalized.credential))
+ is StalkerConfig -> normalized.copy(password = decryptCredential(normalized.password))
+ is JellyfinConfig -> normalized.copy(credential = decryptCredential(normalized.credential))
}
}
diff --git a/data/src/main/java/com/streamvault/data/provider/RoomProviderSnapshotRepository.kt b/data/src/main/java/com/streamvault/data/provider/RoomProviderSnapshotRepository.kt
index eff8821a..64c2ed8a 100644
--- a/data/src/main/java/com/streamvault/data/provider/RoomProviderSnapshotRepository.kt
+++ b/data/src/main/java/com/streamvault/data/provider/RoomProviderSnapshotRepository.kt
@@ -1,5 +1,6 @@
package com.streamvault.data.provider
+import android.util.Log
import com.streamvault.domain.model.Provider as StableProvider
import com.google.gson.Gson
@@ -56,6 +57,28 @@ class RoomProviderSnapshotRepository internal constructor(
storedConfig.configurationGeneration
)
} else null
+ val decodedConfiguration = codec.decodeForKeyMigration(
+ storedConfig.type,
+ storedConfig.encryptedConfigJson
+ )
+ if (decodedConfiguration.requiresReencryption) {
+ runCatching {
+ val replacement = codec.encodeForKeyMigration(decodedConfiguration.configuration)
+ if (replacement.usesPreferredKey &&
+ replacement.payload != storedConfig.encryptedConfigJson
+ ) {
+ snapshotDao.rekeyConfigIfUnchanged(
+ providerId = providerId,
+ configurationGeneration = storedConfig.configurationGeneration,
+ expectedJson = storedConfig.encryptedConfigJson,
+ replacementJson = replacement.payload,
+ updatedAt = System.currentTimeMillis()
+ )
+ }
+ }.onFailure { error ->
+ Log.w(TAG, "Could not migrate provider credential encryption for $providerId.", error)
+ }
+ }
ProviderSnapshot(
provider = StableProvider(
id = provider.id,
@@ -66,7 +89,7 @@ class RoomProviderSnapshotRepository internal constructor(
lastSyncedAt = provider.lastSyncedAt,
createdAt = provider.createdAt
),
- configuration = codec.decode(storedConfig.type, storedConfig.encryptedConfigJson),
+ configuration = decodedConfiguration.configuration,
configurationGeneration = storedConfig.configurationGeneration,
accountRuntime = runtime?.let {
ProviderAccountRuntime(
@@ -104,4 +127,7 @@ class RoomProviderSnapshotRepository internal constructor(
snapshotDao.updateCatalogLayout(providerId, layout, detectionVersion)
}
+ private companion object {
+ const val TAG = "ProviderSnapshotRepository"
+ }
}
diff --git a/data/src/main/java/com/streamvault/data/remote/stalker/OkHttpStalkerApiService.kt b/data/src/main/java/com/streamvault/data/remote/stalker/OkHttpStalkerApiService.kt
index 0c59d770..b35b0491 100644
--- a/data/src/main/java/com/streamvault/data/remote/stalker/OkHttpStalkerApiService.kt
+++ b/data/src/main/java/com/streamvault/data/remote/stalker/OkHttpStalkerApiService.kt
@@ -91,7 +91,7 @@ class OkHttpStalkerApiService @Inject constructor(
private val json: Json,
private val transportFactory: StalkerTransportFactory = StalkerTransportFactory(okHttpClient),
private val requestCoordinator: StalkerRequestCoordinator = StalkerRequestCoordinator()
-) : StalkerApiService {
+) : StalkerApiService, StalkerRawVodPageApi {
private class DirectCreateLinkResponse(val playbackUrl: String) : IOException()
private data class SessionScope(
@@ -801,6 +801,28 @@ class OkHttpStalkerApiService @Inject constructor(
)
}
+ override suspend fun getVodStreamsPageAtPortalPage(
+ session: StalkerSession,
+ profile: StalkerDeviceProfile,
+ categoryId: String?,
+ portalPage: Int,
+ searchQuery: String?
+ ): Result<StalkerPagedItems> = runApiCall("Failed to load movies") {
+ fetchPagedItemPage(
+ session = session,
+ profile = profile,
+ page = portalPage,
+ allowPageZero = true,
+ baseQuery = buildMap {
+ put("type", "vod")
+ put("action", "get_ordered_list")
+ put("JsHttpRequest", "1-xml")
+ categoryId?.takeIf { it.isNotBlank() }?.let { put("category", it) }
+ searchQuery?.trim()?.takeIf { it.isNotBlank() }?.let { put("search", it) }
+ }
+ )
+ }
+
override suspend fun getVodFiles(
session: StalkerSession,
profile: StalkerDeviceProfile,
@@ -1508,11 +1530,12 @@ class OkHttpStalkerApiService @Inject constructor(
session: StalkerSession,
profile: StalkerDeviceProfile,
baseQuery: Map<String, String>,
- page: Int
+ page: Int,
+ allowPageZero: Boolean = false
): StalkerPagedItems {
// The aggregate safety limit belongs to bulk loads. A single-page request must preserve
// the requested cursor so a resumed catalog can move past the historical page-200 cap.
- val safePage = page.coerceAtLeast(1)
+ val safePage = page.coerceAtLeast(if (allowPageZero) 0 else 1)
val payload = requestJson(
url = session.loadUrl,
profile = profile,
diff --git a/data/src/main/java/com/streamvault/data/remote/stalker/StalkerApiService.kt b/data/src/main/java/com/streamvault/data/remote/stalker/StalkerApiService.kt
index e1da689f..00de7a66 100644
--- a/data/src/main/java/com/streamvault/data/remote/stalker/StalkerApiService.kt
+++ b/data/src/main/java/com/streamvault/data/remote/stalker/StalkerApiService.kt
@@ -244,6 +244,17 @@ data class StalkerPagedItems(
get() = !isTruncated && if (hasAdvertisedTotal) page >= totalPages else items.isEmpty()
}
+/** Optional transport capability for probing raw portal page numbers, including `p=0`. */
+interface StalkerRawVodPageApi {
+ suspend fun getVodStreamsPageAtPortalPage(
+ session: StalkerSession,
+ profile: StalkerDeviceProfile,
+ categoryId: String?,
+ portalPage: Int,
+ searchQuery: String? = null
+ ): Result<StalkerPagedItems>
+}
+
data class StalkerSeriesDetails(
val series: StalkerItemRecord,
val seasons: List<StalkerSeasonRecord>,
diff --git a/data/src/main/java/com/streamvault/data/remote/stalker/StalkerPortalStateStore.kt b/data/src/main/java/com/streamvault/data/remote/stalker/StalkerPortalStateStore.kt
index f012947d..5dca97c9 100644
--- a/data/src/main/java/com/streamvault/data/remote/stalker/StalkerPortalStateStore.kt
+++ b/data/src/main/java/com/streamvault/data/remote/stalker/StalkerPortalStateStore.kt
@@ -38,6 +38,49 @@ class StalkerPortalStateStore @Inject constructor(
suspend fun get(providerId: Long): StalkerPortalStateEntity? = dao.get(providerId)
+ /** Returns a learned VOD page offset only while it belongs to this provider configuration. */
+ suspend fun getVodPageBase(providerId: Long, configurationGeneration: Long): Int? {
+ if (providerId <= 0L) return null
+ val state = dao.get(providerId) ?: return null
+ if (state.configurationGeneration != configurationGeneration) return null
+ val learning = runCatching {
+ json.parseToJsonElement(state.learningJson.ifBlank { "{}" }).jsonObject
+ }.getOrNull() ?: return null
+ if (learning["configurationGeneration"]?.jsonPrimitive?.longOrNull != configurationGeneration) {
+ return null
+ }
+ val observation = learning["vodPageBase"]?.jsonObject ?: return null
+ if (observation["configurationGeneration"]?.jsonPrimitive?.longOrNull != configurationGeneration) {
+ return null
+ }
+ return observation["value"]?.jsonPrimitive?.content?.toIntOrNull()?.takeIf { it in 0..1 }
+ }
+
+ /** Stores the portal's 0- or 1-based VOD page offset in the existing generation-fenced envelope. */
+ suspend fun recordVodPageBase(
+ providerId: Long,
+ pageBase: Int,
+ configurationGeneration: Long
+ ) {
+ if (providerId <= 0L || pageBase !in 0..1) return
+ update(providerId, configurationGeneration) { state ->
+ val learning = mutableLearning(state.learningJson)
+ learning["configurationGeneration"] = JsonPrimitive(configurationGeneration)
+ learning["vodPageBase"] = observationJson(
+ pageBase,
+ configurationGeneration,
+ System.currentTimeMillis(),
+ "CATALOG"
+ )
+ state.copy(
+ configurationGeneration = configurationGeneration,
+ learningJson = JsonObject(learning).toString(),
+ observationSource = "CATALOG",
+ observedAt = System.currentTimeMillis()
+ )
+ }
+ }
+
/**
* Durable session resurrected after a process restart. The session envelope is encrypted
* with the app's Keystore-backed credential crypto and is only reused for the same
diff --git a/data/src/main/java/com/streamvault/data/remote/stalker/StalkerProvider.kt b/data/src/main/java/com/streamvault/data/remote/stalker/StalkerProvider.kt
index ec6a3ddd..759f2cc9 100644
--- a/data/src/main/java/com/streamvault/data/remote/stalker/StalkerProvider.kt
+++ b/data/src/main/java/com/streamvault/data/remote/stalker/StalkerProvider.kt
@@ -86,6 +86,16 @@ data class StalkerVodCatalogItem(
private object LiveStreamLimitReached : Exception("live stream cap reached")
+private sealed interface VodPageBaseResolution {
+ data class Known(val pageBase: Int) : VodPageBaseResolution
+ data class Probed(
+ val pageBase: Int,
+ val pageZero: Result<StalkerPagedItems>,
+ val pageOne: Result<StalkerPagedItems>
+ ) : VodPageBaseResolution
+ data class Failed(val result: Result<StalkerPagedItems>) : VodPageBaseResolution
+}
+
class StalkerProvider(
val providerId: Long,
private val api: StalkerApiService,
@@ -151,6 +161,8 @@ internal companion object {
private val sharedPortalAuthCache = ConcurrentHashMap<String, CachedAuth>()
private val sharedAuthFailureCache = ConcurrentHashMap<String, CachedAuthFailure>()
private val sharedAuthMutexes = KeyedMutexRegistry<String>()
+ private val sharedVodPageBaseCache = ConcurrentHashMap<String, Int>()
+ private val sharedVodPageBaseMutexes = KeyedMutexRegistry<String>()
private val resolvedStreamUrlCache = ConcurrentHashMap<String, CachedResolvedUrl>()
private val missingVodClassificationLogged = ConcurrentHashMap.newKeySet<Long>()
@@ -159,6 +171,7 @@ internal companion object {
sharedAuthCache.clear()
sharedPortalAuthCache.clear()
sharedAuthFailureCache.clear()
+ sharedVodPageBaseCache.clear()
}
fun clearResolvedStreamUrlCacheForTests() {
@@ -174,6 +187,8 @@ internal companion object {
val portalPrefix = "portal:$providerId|"
sharedPortalAuthCache.keys.filter { it.startsWith(portalPrefix) }.forEach(sharedPortalAuthCache::remove)
sharedAuthFailureCache.keys.filter { it.startsWith(authPrefix) }.forEach(sharedAuthFailureCache::remove)
+ sharedVodPageBaseCache.keys.filter { it.startsWith("portal:$providerId|") }
+ .forEach(sharedVodPageBaseCache::remove)
resolvedStreamUrlCache.keys
.filter { it.startsWith("$providerId|") }
.forEach(resolvedStreamUrlCache::remove)
@@ -581,23 +596,23 @@ internal companion object {
api.getVodStreams(session, profile, rawCategoryId)
}
return mapResolvedItems(ContentType.MOVIE, result) { item ->
- toMovie(item, requestedCategoryId = categoryId)
+ toMovie(item, requestedCategoryId = categoryId)
}
}
suspend fun getVodStreamsPage(categoryId: Long?, page: Int): Result<StalkerPagedResult<Movie>> =
- mapPagedItems(ContentType.MOVIE, categoryId) { session, profile, rawCategoryId ->
- api.getVodStreamsPage(session, profile, rawCategoryId, page)
- }.let { result -> mapResolvedPage(ContentType.MOVIE, result) { item ->
+ loadVodPageWithPortalPageBase(ContentType.MOVIE, categoryId, page).let { result ->
+ mapResolvedPage(ContentType.MOVIE, result) { item ->
toMovie(item, requestedCategoryId = categoryId)
- } }
+ }
+ }
suspend fun getVodStreamsPageUsingItemCategories(categoryId: Long?, page: Int): Result<StalkerPagedResult<Movie>> =
- mapPagedItems(ContentType.MOVIE, categoryId) { session, profile, rawCategoryId ->
- api.getVodStreamsPage(session, profile, rawCategoryId, page)
- }.let { result -> mapResolvedPage(ContentType.MOVIE, result) { item ->
- toMovie(item, requestedCategoryId = null)
- } }
+ loadVodPageWithPortalPageBase(ContentType.MOVIE, categoryId, page).let { result ->
+ mapResolvedPage(ContentType.MOVIE, result) { item ->
+ toMovie(item, requestedCategoryId = null)
+ }
+ }
suspend fun getUnifiedVodPage(categoryId: Long, page: Int): Result<StalkerPagedResult<StalkerVodCatalogItem>> =
getClassifiedVodPage(ContentType.VOD, categoryId, page)
@@ -678,13 +693,7 @@ internal companion object {
seriesCategoryId: Long? = categoryId,
searchQuery: String? = null
): Result<StalkerPagedResult<StalkerVodCatalogItem>> {
- val rawResult = mapPagedItems(categoryType, categoryId) { session, profile, rawCategoryId ->
- if (searchQuery == null) {
- api.getVodStreamsPage(session, profile, rawCategoryId, page)
- } else {
- api.getVodStreamsPage(session, profile, rawCategoryId, page, searchQuery)
- }
- }
+ val rawResult = loadVodPageWithPortalPageBase(categoryType, categoryId, page, searchQuery)
return when (rawResult) {
is Result.Success -> {
val raw = rawResult.data
@@ -788,19 +797,18 @@ internal companion object {
// empty (providers that serve series inside VOD). Only triggers when the primary
// path produces zero items, so portals using type=series are unaffected.
if (primary is Result.Success && primary.data.items.isEmpty()) {
- val vodPage = mapPagedItems(ContentType.SERIES, categoryId) { session, profile, rawCategoryId ->
- api.getVodStreamsPage(session, profile, rawCategoryId, page)
- }.let { result -> mapResolvedPage(ContentType.SERIES, result) { item ->
- if (item.isSeries) {
- toSeries(
- item,
- requestedCategoryId = categoryId,
- origin = SeriesCatalogOrigin.VOD_DERIVED
- )
- } else {
- null
- }
- } }
+ val vodPage = loadVodPageWithPortalPageBase(ContentType.SERIES, categoryId, page)
+ .let { result -> mapResolvedPage(ContentType.SERIES, result) { item ->
+ if (item.isSeries) {
+ toSeries(
+ item,
+ requestedCategoryId = categoryId,
+ origin = SeriesCatalogOrigin.VOD_DERIVED
+ )
+ } else {
+ null
+ }
+ } }
return vodPage
}
return primary
@@ -1595,6 +1603,185 @@ is Result.Success -> {
}
}
+ /**
+ * The UI and durable index checkpoints use 1-based pages, but Stalker portals differ on
+ * whether `p` starts at zero or one. Probe both values once per provider configuration,
+ * then keep translating logical pages to the portal's raw cursor.
+ */
+ private suspend fun loadVodPageWithPortalPageBase(
+ categoryType: ContentType,
+ categoryId: Long?,
+ logicalPage: Int,
+ searchQuery: String? = null
+ ): Result<StalkerPagedItems> = runWithAuthorizedSession { session, _ ->
+ val profile = currentDeviceProfile()
+ val rawCategoryId = resolveRawCategoryId(categoryType, categoryId)
+ val pageNumber = logicalPage.coerceAtLeast(1)
+ val cacheKey = vodPageBaseCacheKey()
+ if (api !is StalkerRawVodPageApi) {
+ // Legacy transports do not expose a raw p=0 cursor. Keep their established
+ // 1-based call shape and avoid extra requests that cannot teach an offset.
+ val pageResult = if (searchQuery == null) {
+ api.getVodStreamsPage(session, profile, rawCategoryId, pageNumber)
+ } else {
+ api.getVodStreamsPage(session, profile, rawCategoryId, pageNumber, searchQuery)
+ }
+ return@runWithAuthorizedSession normalizeVodPage(pageResult, pageNumber)
+ }
+
+ val resolution = sharedVodPageBaseCache[cacheKey]?.let { VodPageBaseResolution.Known(it) }
+ ?: sharedVodPageBaseMutexes.withLock(cacheKey) {
+ val learnedBase = sharedVodPageBaseCache[cacheKey]
+ ?: portalStateStore?.getVodPageBase(providerId, configurationGeneration)
+ ?.also { sharedVodPageBaseCache[cacheKey] = it }
+ if (learnedBase != null) {
+ return@withLock VodPageBaseResolution.Known(learnedBase)
+ }
+
+ val pageZero = requestVodPageAtPortalPage(
+ session,
+ profile,
+ rawCategoryId,
+ portalPage = 0,
+ searchQuery = searchQuery
+ )
+ if (pageZero is Result.Error && isAuthorizationFailure(pageZero.message, pageZero.exception)) {
+ return@withLock VodPageBaseResolution.Failed(pageZero)
+ }
+ if (pageZero is Result.Loading) {
+ return@withLock VodPageBaseResolution.Failed(Result.error("Unexpected loading state"))
+ }
+
+ val pageOne = requestVodPageAtPortalPage(
+ session,
+ profile,
+ rawCategoryId,
+ portalPage = 1,
+ searchQuery = searchQuery
+ )
+ if (pageOne is Result.Error && isAuthorizationFailure(pageOne.message, pageOne.exception)) {
+ return@withLock VodPageBaseResolution.Failed(pageOne)
+ }
+ if (pageOne is Result.Loading) {
+ return@withLock VodPageBaseResolution.Failed(Result.error("Unexpected loading state"))
+ }
+
+ val detectedBase = inferVodPageBase(pageZero, pageOne)
+ if (detectedBase != null) {
+ sharedVodPageBaseCache[cacheKey] = detectedBase
+ portalStateStore?.recordVodPageBase(
+ providerId = providerId,
+ pageBase = detectedBase,
+ configurationGeneration = configurationGeneration
+ )
+ } else if (pageZero is Result.Error) {
+ // A transient failure on p=0 must not silently map page two to page one.
+ return@withLock VodPageBaseResolution.Failed(pageZero)
+ }
+ VodPageBaseResolution.Probed(detectedBase ?: 1, pageZero, pageOne)
+ }
+
+ when (resolution) {
+ is VodPageBaseResolution.Failed -> resolution.result
+ is VodPageBaseResolution.Known -> {
+ val portalPage = (pageNumber - 1 + resolution.pageBase).coerceAtLeast(0)
+ normalizeVodPage(
+ requestVodPageAtPortalPage(
+ session,
+ profile,
+ rawCategoryId,
+ portalPage,
+ searchQuery
+ ),
+ pageNumber
+ )
+ }
+ is VodPageBaseResolution.Probed -> {
+ val portalPage = (pageNumber - 1 + resolution.pageBase).coerceAtLeast(0)
+ val target = when (portalPage) {
+ 0 -> resolution.pageZero
+ 1 -> resolution.pageOne
+ else -> requestVodPageAtPortalPage(
+ session,
+ profile,
+ rawCategoryId,
+ portalPage,
+ searchQuery
+ )
+ }
+ normalizeVodPage(target, pageNumber)
+ }
+ }
+ }
+
+ private fun inferVodPageBase(
+ pageZero: Result<StalkerPagedItems>,
+ pageOne: Result<StalkerPagedItems>
+ ): Int? = when (pageZero) {
+ is Result.Success -> when (pageOne) {
+ is Result.Success -> {
+ val first = pageZero.data.items
+ val second = pageOne.data.items
+ when {
+ first.isEmpty() && second.isEmpty() -> null
+ first.isNotEmpty() && second.isNotEmpty() && sameVodPage(first, second) -> 1
+ first.isNotEmpty() -> 0
+ else -> 1
+ }
+ }
+ is Result.Error -> if (pageZero.data.items.isNotEmpty()) 0 else null
+ is Result.Loading -> null
+ }
+ is Result.Error -> if (isPortalZeroPageRejection(pageZero) && pageOne is Result.Success) 1 else null
+ is Result.Loading -> null
+ }
+
+ private fun sameVodPage(
+ first: List<StalkerItemRecord>,
+ second: List<StalkerItemRecord>
+ ): Boolean = first.map { it.id.trim() to it.name.trim() } ==
+ second.map { it.id.trim() to it.name.trim() }
+
+ private fun isPortalZeroPageRejection(result: Result.Error): Boolean {
+ val error = result.exception ?: return false
+ if (error.isStalkerAuthorizationFailure()) return false
+ return when (error) {
+ is StalkerApiError.EmptyBody,
+ is StalkerApiError.Malformed -> true
+ is StalkerApiError -> error.httpStatus?.let { it in 400..499 && it !in setOf(401, 403, 429) } == true
+ else -> false
+ }
+ }
+
+ private fun normalizeVodPage(
+ result: Result<StalkerPagedItems>?,
+ logicalPage: Int
+ ): Result<StalkerPagedItems> = when (result) {
+ is Result.Success -> Result.success(result.data.copy(page = logicalPage))
+ is Result.Error -> Result.error(result.message, result.exception)
+ is Result.Loading -> Result.error("Unexpected loading state")
+ null -> Result.error("Portal returned no page response")
+ }
+
+ private fun vodPageBaseCacheKey(): String =
+ "${portalIdentityKey()}|generation:$configurationGeneration|vod-page-base"
+
+ private suspend fun requestVodPageAtPortalPage(
+ session: StalkerSession,
+ profile: StalkerDeviceProfile,
+ categoryId: String?,
+ portalPage: Int,
+ searchQuery: String?
+ ): Result<StalkerPagedItems> {
+ return (api as StalkerRawVodPageApi).getVodStreamsPageAtPortalPage(
+ session,
+ profile,
+ categoryId,
+ portalPage,
+ searchQuery
+ )
+ }
+
private suspend fun mapPagedItems(
type: ContentType,
categoryId: Long?,
diff --git a/data/src/main/java/com/streamvault/data/repository/ProviderRepositoryImpl.kt b/data/src/main/java/com/streamvault/data/repository/ProviderRepositoryImpl.kt
index 9d776caa..c9937d41 100644
--- a/data/src/main/java/com/streamvault/data/repository/ProviderRepositoryImpl.kt
+++ b/data/src/main/java/com/streamvault/data/repository/ProviderRepositoryImpl.kt
@@ -29,7 +29,6 @@ import com.streamvault.data.provider.ProviderObservationStreams
import com.streamvault.data.provider.StalkerClientOptions
import com.streamvault.data.provider.TypedProviderClientFactory
import com.streamvault.data.provider.toAccountRuntime
-import com.streamvault.data.provider.redactedCredentials
import com.streamvault.data.provider.toTypedConfiguration
import com.streamvault.data.provider.toLegacyProvider
import com.streamvault.data.provider.guidePolicy
@@ -169,8 +168,10 @@ class ProviderRepositoryImpl @Inject constructor(
override fun getActiveProvider(): Flow<Provider?> = observationStreams.activeProvider
- override suspend fun getProvider(id: Long): Provider? =
- loadLegacyProvider(id)?.redactedCredentials()
+ override suspend fun getProvider(id: Long): Provider? {
+ if (providerSnapshotDao.getConfig(id) == null) return null
+ return observationStreams.providers.first().firstOrNull { it.id == id }
+ }
override suspend fun addProvider(provider: Provider): Result<Long> = try {
val id = transactionRunner.inTransaction {
@@ -215,13 +216,20 @@ class ProviderRepositoryImpl @Inject constructor(
return Result.error("Complete search indexing is only available for Stalker providers")
}
val now = System.currentTimeMillis()
+ val sections = if (
+ providerSnapshotDao.getRuntime(providerId)?.catalogLayout == CatalogLayout.UNIFIED_VOD
+ ) {
+ listOf(ContentType.MOVIE)
+ } else {
+ listOf(ContentType.MOVIE, ContentType.SERIES)
+ }
transactionRunner.inTransaction {
// A manual rebuild is an explicit retry of every category, including rows
// previously marked COMPLETE, TRUNCATED, or terminally failed. Keep the
// current searchable content visible while resetting only crawl progress.
movieCategoryHydrationDao.deleteByProvider(providerId)
seriesCategoryHydrationDao.deleteByProvider(providerId)
- listOf(ContentType.MOVIE, ContentType.SERIES).forEach { section ->
+ sections.forEach { section ->
stalkerIndexJobDao.upsert(
StalkerIndexJobEntity(
providerId = providerId,
@@ -905,7 +913,7 @@ class ProviderRepositoryImpl @Inject constructor(
repairConnection: Boolean = false,
requestedProfileId: String = StalkerCompatibilityProfileIds.AUTO,
epgSyncMode: ProviderEpgSyncMode = ProviderEpgSyncMode.BACKGROUND,
- catalogMode: StalkerCatalogMode = StalkerCatalogMode.ON_DEMAND,
+ catalogMode: StalkerCatalogMode = StalkerCatalogMode.BACKGROUND_INDEX,
guideSourcePolicy: GuideSourcePolicy = GuideSourcePolicy.AUTO,
channelLogoSourcePolicy: ChannelLogoSourcePolicy = ChannelLogoSourcePolicy.SUPPLIER_PREFERRED,
onProgress: ((String) -> Unit)? = null,
@@ -1795,16 +1803,24 @@ class ProviderRepositoryImpl @Inject constructor(
epgChannelId: String?,
limit: Int
): Result<List<Program>> {
- val providerEntity = loadLegacyProvider(providerId)
+ val providerEntity = try {
+ loadLegacyProvider(providerId)
+ } catch (error: CredentialDecryptionException) {
+ return Result.error(error.message ?: CredentialDecryptionException.MESSAGE, error)
+ }
?: return Result.error("Provider $providerId not found")
if (!allowsOnDemandGuide(providerEntity)) {
return Result.error("On-demand guide lookup is disabled for this provider.")
}
- val guide = when (val resolution = resolveGuideCapability(providerId)) {
- is CapabilityResolution.Available -> resolution.capability
- is CapabilityResolution.ConfigurationError -> return Result.error(resolution.reason)
- is CapabilityResolution.Restricted -> return Result.error(resolution.reason)
- is CapabilityResolution.Unsupported -> return Result.error(resolution.reason)
+ val guide = try {
+ when (val resolution = resolveGuideCapability(providerId)) {
+ is CapabilityResolution.Available -> resolution.capability
+ is CapabilityResolution.ConfigurationError -> return Result.error(resolution.reason)
+ is CapabilityResolution.Restricted -> return Result.error(resolution.reason)
+ is CapabilityResolution.Unsupported -> return Result.error(resolution.reason)
+ }
+ } catch (error: CredentialDecryptionException) {
+ return Result.error(error.message ?: CredentialDecryptionException.MESSAGE, error)
}
val result = fetchProgramsForLiveStream(
providerId = providerId,
@@ -1833,7 +1849,13 @@ class ProviderRepositoryImpl @Inject constructor(
return emptyMap()
}
- val providerEntity = loadLegacyProvider(providerId)
+ val providerEntity = try {
+ loadLegacyProvider(providerId)
+ } catch (error: CredentialDecryptionException) {
+ return normalizedRequests.associateWith {
+ Result.error(error.message ?: CredentialDecryptionException.MESSAGE, error)
+ }
+ }
?: return normalizedRequests.associateWith { Result.error("Provider $providerId not found") }
if (!allowsOnDemandGuide(providerEntity)) {
return normalizedRequests.associateWith {
@@ -1841,11 +1863,17 @@ class ProviderRepositoryImpl @Inject constructor(
}
}
- val guide = when (val resolution = resolveGuideCapability(providerId)) {
- is CapabilityResolution.Available -> resolution.capability
- is CapabilityResolution.ConfigurationError -> return normalizedRequests.associateWith { Result.error(resolution.reason) }
- is CapabilityResolution.Restricted -> return normalizedRequests.associateWith { Result.error(resolution.reason) }
- is CapabilityResolution.Unsupported -> return normalizedRequests.associateWith { Result.error(resolution.reason) }
+ val guide = try {
+ when (val resolution = resolveGuideCapability(providerId)) {
+ is CapabilityResolution.Available -> resolution.capability
+ is CapabilityResolution.ConfigurationError -> return normalizedRequests.associateWith { Result.error(resolution.reason) }
+ is CapabilityResolution.Restricted -> return normalizedRequests.associateWith { Result.error(resolution.reason) }
+ is CapabilityResolution.Unsupported -> return normalizedRequests.associateWith { Result.error(resolution.reason) }
+ }
+ } catch (error: CredentialDecryptionException) {
+ return normalizedRequests.associateWith {
+ Result.error(error.message ?: CredentialDecryptionException.MESSAGE, error)
+ }
}
return coroutineScope {
val requestDispatcher = Dispatchers.IO.limitedParallelism(XTREAM_GUIDE_BATCH_CONCURRENCY)
diff --git a/data/src/main/java/com/streamvault/data/repository/SearchRepositoryImpl.kt b/data/src/main/java/com/streamvault/data/repository/SearchRepositoryImpl.kt
index da15fecc..6bb58cde 100644
--- a/data/src/main/java/com/streamvault/data/repository/SearchRepositoryImpl.kt
+++ b/data/src/main/java/com/streamvault/data/repository/SearchRepositoryImpl.kt
@@ -4,21 +4,26 @@ import android.database.sqlite.SQLiteException
import android.util.Log
import com.streamvault.data.local.dao.SearchDao
import com.streamvault.data.local.dao.ProviderDao
+import com.streamvault.data.local.dao.ProviderSnapshotDao
import com.streamvault.data.local.dao.StalkerIndexJobDao
import com.streamvault.data.local.dao.SearchHitEntity
import com.streamvault.data.util.toFtsPrefixQuery
import com.streamvault.domain.model.Channel
+import com.streamvault.domain.model.CatalogLayout
import com.streamvault.domain.model.CatalogCompleteness
import com.streamvault.domain.model.ContentType
import com.streamvault.domain.model.Movie
import com.streamvault.domain.model.Series
import com.streamvault.domain.model.ProviderType
import com.streamvault.domain.model.StalkerIndexState
+import com.streamvault.domain.model.VodCatalogItem
+import com.streamvault.domain.model.Result
import com.streamvault.domain.repository.ChannelRepository
import com.streamvault.domain.repository.MovieRepository
import com.streamvault.domain.repository.SearchRepository
import com.streamvault.domain.repository.SearchRepositoryResult
import com.streamvault.domain.repository.SeriesRepository
+import com.streamvault.domain.repository.VodRepository
import javax.inject.Inject
import javax.inject.Singleton
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -27,8 +32,11 @@ import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
+import kotlinx.coroutines.flow.flow
+import kotlinx.coroutines.flow.emitAll
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.flow.onStart
@Singleton
@OptIn(ExperimentalCoroutinesApi::class)
@@ -38,7 +46,9 @@ class SearchRepositoryImpl @Inject constructor(
private val movieRepository: MovieRepository,
private val seriesRepository: SeriesRepository,
private val providerDao: ProviderDao,
- private val stalkerIndexJobDao: StalkerIndexJobDao
+ private val stalkerIndexJobDao: StalkerIndexJobDao,
+ private val providerSnapshotDao: ProviderSnapshotDao,
+ private val vodRepository: VodRepository
) : SearchRepository {
override fun searchContent(
providerId: Long,
@@ -56,7 +66,7 @@ class SearchRepositoryImpl @Inject constructor(
return flowOf(SearchRepositoryResult())
}
- return searchHits(
+ val localResults = searchHits(
providerId = providerId,
ftsQuery = ftsQuery,
rawQuery = normalizedQuery,
@@ -151,6 +161,34 @@ class SearchRepositoryImpl @Inject constructor(
)
)
}
+
+ return flow {
+ val provider = providerDao.getById(providerId)
+ if (provider?.type != ProviderType.STALKER_PORTAL || (!includeMovies && !includeSeries)) {
+ emitAll(localResults)
+ return@flow
+ }
+
+ val completeness = catalogCompleteness(providerId, includeMovies, includeSeries)
+ if (completeness == CatalogCompleteness.COMPLETE) {
+ emitAll(localResults)
+ return@flow
+ }
+
+ emitAll(
+ combine(
+ localResults,
+ searchPortalVod(
+ providerId = providerId,
+ query = normalizedQuery,
+ includeMovies = includeMovies,
+ includeSeries = includeSeries,
+ maxResultsPerSection = maxResultsPerSection
+ )
+ .onStart { emit(SearchRepositoryResult()) }
+ ) { local, remote -> mergeVodSearchResults(local, remote, maxResultsPerSection) }
+ )
+ }
}
private suspend fun catalogCompleteness(
@@ -161,9 +199,15 @@ class SearchRepositoryImpl @Inject constructor(
if (!includeMovies && !includeSeries) return CatalogCompleteness.COMPLETE
val provider = providerDao.getById(providerId) ?: return CatalogCompleteness.PARTIAL
if (provider.type != ProviderType.STALKER_PORTAL) return CatalogCompleteness.COMPLETE
- val sections = buildList {
- if (includeMovies) add(ContentType.MOVIE)
- if (includeSeries) add(ContentType.SERIES)
+ val sections = if (
+ providerSnapshotDao.getRuntime(providerId)?.catalogLayout == CatalogLayout.UNIFIED_VOD
+ ) {
+ listOf(ContentType.MOVIE)
+ } else {
+ buildList {
+ if (includeMovies) add(ContentType.MOVIE)
+ if (includeSeries) add(ContentType.SERIES)
+ }
}
val states = sections.map { section -> stalkerIndexJobDao.get(providerId, section.name)?.state }
return when {
@@ -175,6 +219,68 @@ class SearchRepositoryImpl @Inject constructor(
}
}
+ private fun searchPortalVod(
+ providerId: Long,
+ query: String,
+ includeMovies: Boolean,
+ includeSeries: Boolean,
+ maxResultsPerSection: Int
+ ): Flow<SearchRepositoryResult> = flow {
+ val movies = linkedMapOf<Long, Movie>()
+ val series = linkedMapOf<String, Series>()
+ var page = 1
+ var hasMore: Boolean
+ do {
+ val result = try {
+ vodRepository.searchVod(providerId, query, page)
+ } catch (cancelled: kotlinx.coroutines.CancellationException) {
+ throw cancelled
+ } catch (_: Throwable) {
+ break
+ }
+ when (result) {
+ is Result.Success -> {
+ result.data.items.forEach { item ->
+ when (item) {
+ is VodCatalogItem.MovieItem -> if (includeMovies) {
+ movies.putIfAbsent(item.movie.id, item.movie)
+ }
+ is VodCatalogItem.SeriesItem -> if (includeSeries) {
+ series.putIfAbsent(item.series.id.toString(), item.series)
+ }
+ }
+ }
+ hasMore = result.data.hasMore
+ page = result.data.page + 1
+ }
+ is Result.Error,
+ is Result.Loading -> break
+ }
+ } while (
+ hasMore && page <= MAX_PORTAL_SEARCH_PAGES &&
+ ((includeMovies && movies.size < maxResultsPerSection) ||
+ (includeSeries && series.size < maxResultsPerSection))
+ )
+
+ emit(
+ SearchRepositoryResult(
+ movies = movies.values.take(maxResultsPerSection),
+ series = series.values.take(maxResultsPerSection)
+ )
+ )
+ }
+
+ private fun mergeVodSearchResults(
+ local: SearchRepositoryResult,
+ remote: SearchRepositoryResult,
+ maxResultsPerSection: Int
+ ): SearchRepositoryResult = local.copy(
+ movies = (local.movies + remote.movies).distinctBy(Movie::id).take(maxResultsPerSection),
+ series = (local.series + remote.series).distinctBy {
+ it.id
+ }.take(maxResultsPerSection)
+ )
+
override fun searchChannels(providerId: Long, query: String): Flow<List<Channel>> =
channelRepository.searchChannels(providerId, query)
@@ -350,6 +456,7 @@ class SearchRepositoryImpl @Inject constructor(
const val SERIES_TYPE = "SERIES"
const val SLOW_FTS_LOG_THRESHOLD_MS = 250L
const val SLOW_TOTAL_LOG_THRESHOLD_MS = 500L
+ const val MAX_PORTAL_SEARCH_PAGES = 12
}
private sealed interface SearchLookupState {
diff --git a/data/src/main/java/com/streamvault/data/security/CredentialCrypto.kt b/data/src/main/java/com/streamvault/data/security/CredentialCrypto.kt
index b50d83c6..e166ad92 100644
--- a/data/src/main/java/com/streamvault/data/security/CredentialCrypto.kt
+++ b/data/src/main/java/com/streamvault/data/security/CredentialCrypto.kt
@@ -3,9 +3,11 @@ package com.streamvault.data.security
import android.content.Context
import android.security.keystore.KeyGenParameterSpec
import android.security.keystore.KeyProperties
+import android.util.AtomicFile
import android.util.Log
import dagger.hilt.android.qualifiers.ApplicationContext
import java.io.File
+import java.io.IOException
import java.security.KeyStore
import javax.crypto.Cipher
import javax.crypto.KeyGenerator
@@ -22,8 +24,26 @@ import javax.inject.Singleton
interface CredentialCrypto {
fun encryptIfNeeded(value: String): String
fun decryptIfNeeded(value: String): String
+
+ /** Reports whether encryption used the key selected as preferred for future reads. */
+ fun encryptWithKeyMigration(value: String): CredentialEncryptionResult =
+ CredentialEncryptionResult(encryptedValue = encryptIfNeeded(value))
+
+ /** Indicates whether a successful fallback decrypt should be persisted with the preferred key. */
+ fun decryptWithKeyMigration(value: String): CredentialDecryptionResult =
+ CredentialDecryptionResult(cleartext = decryptIfNeeded(value))
}
+data class CredentialEncryptionResult(
+ val encryptedValue: String,
+ val usesPreferredKey: Boolean = true
+)
+
+data class CredentialDecryptionResult(
+ val cleartext: String,
+ val requiresReencryption: Boolean = false
+)
+
/**
* Production implementation backed by the Android Keystore system.
*
@@ -45,6 +65,8 @@ class AndroidKeystoreCredentialCrypto @Inject constructor(
private val SOFTWARE_KEY_SIZE_BITS = 256
private val softwareKeyFile: File
get() = File(context.filesDir, SOFTWARE_KEY_FILE_NAME)
+ private val softwareKeyAtomicFile: AtomicFile
+ get() = AtomicFile(softwareKeyFile)
private val hardwareSecretKeyProvider = CachingSecretKeyProvider(::loadOrCreateHardwareSecretKey)
private val softwareSecretKeyProvider = CachingSecretKeyProvider(::loadOrCreateSoftwareSecretKey)
@@ -61,8 +83,13 @@ class AndroidKeystoreCredentialCrypto @Inject constructor(
val source: KeySource
)
- override fun encryptIfNeeded(value: String): String {
- if (value.isBlank() || value.startsWith(PREFIX)) return value
+ override fun encryptIfNeeded(value: String): String =
+ encryptWithKeyMigration(value).encryptedValue
+
+ override fun encryptWithKeyMigration(value: String): CredentialEncryptionResult {
+ if (value.isBlank() || value.startsWith(PREFIX)) {
+ return CredentialEncryptionResult(encryptedValue = value)
+ }
val selectedKey = try {
selectPreferredKey()
@@ -71,28 +98,42 @@ class AndroidKeystoreCredentialCrypto @Inject constructor(
}
return try {
- encryptWithKey(value, selectedKey.secretKey)
- } catch (e: Exception) {
- if (selectedKey.source == KeySource.SOFTWARE) {
- throw encryptionFailure(e)
- }
-
- // A hardware key can be returned successfully while failing during cipher.init or
- // doFinal. Pin the app to the software key after the first successful fallback.
- Log.w(TAG, "Hardware-backed credential encryption failed; retrying with a software key.", e)
+ CredentialEncryptionResult(encryptedValue = encryptWithKey(value, selectedKey.secretKey))
+ } catch (primaryException: Exception) {
+ // Either key can fail after it has loaded. Try the other available source before
+ // failing; decryption will also try that source if it opens this ciphertext later.
+ Log.w(
+ TAG,
+ "Preferred credential key encryption failed; retrying with an alternate key.",
+ primaryException
+ )
try {
- val softwareKey = softwareSecretKeyProvider.get()
- preferSoftwareKey = true
- encryptWithKey(value, softwareKey)
+ when (selectedKey.source) {
+ KeySource.HARDWARE -> {
+ val softwareKey = softwareSecretKeyProvider.get()
+ preferSoftwareKey = true
+ CredentialEncryptionResult(
+ encryptedValue = encryptWithKey(value, softwareKey)
+ )
+ }
+ KeySource.SOFTWARE -> CredentialEncryptionResult(
+ encryptedValue = encryptWithKey(value, hardwareSecretKeyProvider.get()),
+ usesPreferredKey = false
+ )
+ }
} catch (fallbackException: Exception) {
- if (fallbackException !== e) e.addSuppressed(fallbackException)
- throw encryptionFailure(e)
+ if (fallbackException !== primaryException) {
+ primaryException.addSuppressed(fallbackException)
+ }
+ throw encryptionFailure(primaryException)
}
}
}
- override fun decryptIfNeeded(value: String): String {
- if (!value.startsWith(PREFIX)) return value
+ override fun decryptIfNeeded(value: String): String = decryptWithKeyMigration(value).cleartext
+
+ override fun decryptWithKeyMigration(value: String): CredentialDecryptionResult {
+ if (!value.startsWith(PREFIX)) return CredentialDecryptionResult(cleartext = value)
return try {
val payload = value.removePrefix(PREFIX)
@@ -106,13 +147,17 @@ class AndroidKeystoreCredentialCrypto @Inject constructor(
val selectedKey = selectPreferredKey()
try {
- decryptWithKey(selectedKey.secretKey, iv, ciphertext)
+ CredentialDecryptionResult(
+ cleartext = decryptWithKey(selectedKey.secretKey, iv, ciphertext)
+ )
} catch (primaryException: Exception) {
val alternateKey = try {
when (selectedKey.source) {
- KeySource.HARDWARE -> softwareKeyFile
- .takeIf(File::exists)
- ?.let { softwareSecretKeyProvider.get() }
+ KeySource.HARDWARE -> if (softwareKeyFile.exists()) {
+ softwareSecretKeyProvider.get()
+ } else {
+ null
+ }
KeySource.SOFTWARE -> loadExistingHardwareSecretKey()
}
@@ -128,7 +173,10 @@ class AndroidKeystoreCredentialCrypto @Inject constructor(
}
try {
- decryptWithKey(alternateKey, iv, ciphertext)
+ CredentialDecryptionResult(
+ cleartext = decryptWithKey(alternateKey, iv, ciphertext),
+ requiresReencryption = true
+ )
} catch (alternateException: Exception) {
if (alternateException !== primaryException) {
primaryException.addSuppressed(alternateException)
@@ -144,9 +192,31 @@ class AndroidKeystoreCredentialCrypto @Inject constructor(
@Synchronized
private fun selectPreferredKey(): SelectedKey {
- if (preferSoftwareKey || softwareKeyFile.exists()) {
- preferSoftwareKey = true
- return SelectedKey(softwareSecretKeyProvider.get(), KeySource.SOFTWARE)
+ val softwareFileExists = softwareKeyFile.exists()
+ if (preferSoftwareKey || softwareFileExists) {
+ try {
+ val softwareKey = softwareSecretKeyProvider.get()
+ preferSoftwareKey = true
+ return SelectedKey(softwareKey, KeySource.SOFTWARE)
+ } catch (softwareException: Exception) {
+ if (softwareFileExists) {
+ // Preserve any hardware-encrypted credentials if the software key file was
+ // damaged or could not be read. Do not overwrite it with a new random key.
+ Log.w(
+ TAG,
+ "The existing software credential key is unavailable; trying hardware.",
+ softwareException
+ )
+ }
+ return try {
+ SelectedKey(hardwareSecretKeyProvider.get(), KeySource.HARDWARE)
+ } catch (hardwareException: Exception) {
+ if (hardwareException !== softwareException) {
+ softwareException.addSuppressed(hardwareException)
+ }
+ throw softwareException
+ }
+ }
}
return try {
@@ -224,14 +294,32 @@ class AndroidKeystoreCredentialCrypto @Inject constructor(
* The key material stays in the app sandbox and credentials remain encrypted at rest.
*/
private fun loadOrCreateSoftwareSecretKey(): SecretKey {
+ val atomicFile = softwareKeyAtomicFile
if (softwareKeyFile.exists()) {
- return SecretKeySpec(softwareKeyFile.readBytes(), SOFTWARE_KEY_ALGORITHM)
+ return readSoftwareSecretKey(atomicFile)
}
val keyGenerator = KeyGenerator.getInstance(SOFTWARE_KEY_ALGORITHM)
keyGenerator.init(SOFTWARE_KEY_SIZE_BITS)
val key = keyGenerator.generateKey()
- softwareKeyFile.writeBytes(key.encoded)
- return key
+ val output = atomicFile.startWrite()
+ try {
+ output.write(key.encoded)
+ atomicFile.finishWrite(output)
+ } catch (e: Exception) {
+ runCatching { atomicFile.failWrite(output) }
+ .onFailure { cleanupException -> e.addSuppressed(cleanupException) }
+ throw e
+ }
+ // Read the committed bytes back so this provider caches exactly what survives a restart.
+ return readSoftwareSecretKey(atomicFile)
+ }
+
+ private fun readSoftwareSecretKey(atomicFile: AtomicFile): SecretKey {
+ val encoded = atomicFile.openRead().use { it.readBytes() }
+ if (encoded.size != SOFTWARE_KEY_SIZE_BITS / 8) {
+ throw IOException("Software credential key has an invalid length")
+ }
+ return SecretKeySpec(encoded, SOFTWARE_KEY_ALGORITHM)
}
}
diff --git a/data/src/main/java/com/streamvault/data/sync/AutomaticSyncRunner.kt b/data/src/main/java/com/streamvault/data/sync/AutomaticSyncRunner.kt
index 17c76ccb..535d6486 100644
--- a/data/src/main/java/com/streamvault/data/sync/AutomaticSyncRunner.kt
+++ b/data/src/main/java/com/streamvault/data/sync/AutomaticSyncRunner.kt
@@ -139,7 +139,7 @@ class AutomaticSyncRunner @Inject constructor(
val content = when (section) { RefreshSection.MOVIES -> ContentType.MOVIE; RefreshSection.SERIES -> ContentType.SERIES; else -> return false }
return when (snapshot.provider.type) {
ProviderType.XTREAM_CODES -> xtreamJobs.get(providerId, content.name)?.state == "FAILED_PERMANENT"
- ProviderType.STALKER_PORTAL -> snapshot.accountRuntime.catalogLayout != CatalogLayout.UNIFIED_VOD &&
+ ProviderType.STALKER_PORTAL ->
stalkerJobs.get(providerId, content)?.state == StalkerIndexState.FAILED
else -> false
}
@@ -196,8 +196,7 @@ class AutomaticSyncRunner @Inject constructor(
lastMovieSuccess = indexSuccess(xtreamJobs.get(providerId, ContentType.MOVIE.name), metadata?.lastMovieSuccess ?: 0L),
lastSeriesSuccess = indexSuccess(xtreamJobs.get(providerId, ContentType.SERIES.name), metadata?.lastSeriesSuccess ?: 0L)
)
- } else if ((snapshot.configuration as? StalkerConfig)?.catalogMode == StalkerCatalogMode.BACKGROUND_INDEX &&
- snapshot.accountRuntime.catalogLayout != CatalogLayout.UNIFIED_VOD) {
+ } else if ((snapshot.configuration as? StalkerConfig)?.catalogMode == StalkerCatalogMode.BACKGROUND_INDEX) {
suspend fun success(section: ContentType, fallback: Long): Long {
val job = stalkerJobs.get(providerId, section)
return if (job?.state in setOf(StalkerIndexState.QUEUED, StalkerIndexState.RUNNING, StalkerIndexState.RETRY_WAIT, StalkerIndexState.PARTIAL)) 0L
diff --git a/data/src/main/java/com/streamvault/data/sync/StalkerCatalogSectionExecutor.kt b/data/src/main/java/com/streamvault/data/sync/StalkerCatalogSectionExecutor.kt
index dfa96c26..b28844ce 100644
--- a/data/src/main/java/com/streamvault/data/sync/StalkerCatalogSectionExecutor.kt
+++ b/data/src/main/java/com/streamvault/data/sync/StalkerCatalogSectionExecutor.kt
@@ -86,7 +86,7 @@ internal class StalkerCatalogSectionExecutor(
)
}
)
- if (!indexCatalog || unified) {
+ if (!indexCatalog) {
// Refresh category contents lazily, retaining cached rows until replacement.
movieCategoryHydrationDao.deleteByProvider(provider.id)
if (unified) invalidateUnifiedVod(provider.id)
@@ -94,6 +94,7 @@ internal class StalkerCatalogSectionExecutor(
syncMetadataRepository.updateMetadata(current.copy(lastMovieSync = now, lastMovieSuccess = now))
return SyncOutcome(activation = SyncActivation.ACTIVATED_CATALOG)
}
+ if (unified) invalidateUnifiedVod(provider.id)
queueIndexSection(provider.id, ContentType.MOVIE, categories.size, now)
val metadata = (syncMetadataRepository.getMetadata(provider.id) ?: SyncMetadata(provider.id))
.copy(
diff --git a/data/src/main/java/com/streamvault/data/sync/StalkerCatalogSyncExecutor.kt b/data/src/main/java/com/streamvault/data/sync/StalkerCatalogSyncExecutor.kt
index 509057a7..17760892 100644
--- a/data/src/main/java/com/streamvault/data/sync/StalkerCatalogSyncExecutor.kt
+++ b/data/src/main/java/com/streamvault/data/sync/StalkerCatalogSyncExecutor.kt
@@ -243,14 +243,15 @@ internal class StalkerCatalogSyncExecutor(
catalogActivated = true
if (effectiveCatalogLayout == CatalogLayout.SPLIT) {
movieCategoryHydrationDao.deleteByProvider(provider.id)
+ } else {
+ vodCategoryHydrationDao.deleteByProvider(provider.id)
}
categoryDao.deleteByProviderAndType(
provider.id,
if (storedCategoryType == ContentType.VOD) ContentType.MOVIE.name else ContentType.VOD.name
)
movieCategoryCount = categories.size
- if (!bootstrap && effectiveCatalogLayout != CatalogLayout.UNIFIED_VOD &&
- provider.stalkerCatalogMode == StalkerCatalogMode.BACKGROUND_INDEX
+ if (!bootstrap && provider.stalkerCatalogMode == StalkerCatalogMode.BACKGROUND_INDEX
) {
sectionExecutor.queueIndexSection(provider.id, ContentType.MOVIE, categories.size, now)
}
diff --git a/data/src/main/java/com/streamvault/data/sync/StalkerIncrementalIndexExecutor.kt b/data/src/main/java/com/streamvault/data/sync/StalkerIncrementalIndexExecutor.kt
index cc070c14..cf21a857 100644
--- a/data/src/main/java/com/streamvault/data/sync/StalkerIncrementalIndexExecutor.kt
+++ b/data/src/main/java/com/streamvault/data/sync/StalkerIncrementalIndexExecutor.kt
@@ -172,7 +172,7 @@ internal class StalkerIncrementalIndexExecutor(
val allVisibleCategories = operations.allVisibleCategories(provider.id, contentType)
val visibleCategories = operations.visibleCategories(contentType, allVisibleCategories, api)
val wildcardCategory = allVisibleCategories.firstOrNull { category ->
- api.isWildcardCategory(contentType, category.categoryId)
+ api.isWildcardCategory(category.type, category.categoryId)
}
if (visibleCategories.isEmpty()) {
val deletedRows = operations.pruneStaleRows(provider.id, contentType)
@@ -584,7 +584,7 @@ internal class StalkerIncrementalIndexExecutor(
val now = System.currentTimeMillis()
val normalVisibleCategoryIds = mutableSetOf<Long>()
visibleCategories.forEach { category ->
- if (!api.isWildcardCategory(contentType, category.categoryId)) {
+ if (!api.isWildcardCategory(category.type, category.categoryId)) {
normalVisibleCategoryIds += category.categoryId
}
}
diff --git a/data/src/main/java/com/streamvault/data/sync/StalkerIndexContinuationCoordinator.kt b/data/src/main/java/com/streamvault/data/sync/StalkerIndexContinuationCoordinator.kt
index 986701d4..0ac7346b 100644
--- a/data/src/main/java/com/streamvault/data/sync/StalkerIndexContinuationCoordinator.kt
+++ b/data/src/main/java/com/streamvault/data/sync/StalkerIndexContinuationCoordinator.kt
@@ -42,7 +42,19 @@ internal class StalkerIndexContinuationCoordinator(
now: Long
): StalkerCatalogDecision {
val movie = sectionState(provider, api, ContentType.MOVIE, force, now)
- val series = sectionState(provider, api, ContentType.SERIES, force, now)
+ val series = if (provider.catalogLayout == com.streamvault.domain.model.CatalogLayout.UNIFIED_VOD) {
+ val job = stalkerIndexJobStore.get(provider.id, ContentType.SERIES)
+ StalkerCatalogSectionState(
+ contentType = ContentType.SERIES,
+ runnable = false,
+ retryDelaySeconds = 0L,
+ pending = false,
+ jobState = job?.state?.let(stalkerIndexJobStore::toLegacyState),
+ updatedAt = job?.updatedAt ?: 0L
+ )
+ } else {
+ sectionState(provider, api, ContentType.SERIES, force, now)
+ }
return StalkerIndexPolicy.chooseNextSection(
layout = provider.catalogLayout,
requestedSection = requestedSection,
@@ -87,7 +99,12 @@ internal class StalkerIndexContinuationCoordinator(
val provider = loadProvider(providerId) ?: return@forEach
// v62 and older reused Xtream rows. They are never valid Stalker owners now.
deleteLegacyJobs(provider.id)
- val hasPendingOneTime = listOf(ContentType.MOVIE, ContentType.SERIES).any { section ->
+ val sections = if (provider.catalogLayout == com.streamvault.domain.model.CatalogLayout.UNIFIED_VOD) {
+ listOf(ContentType.MOVIE)
+ } else {
+ listOf(ContentType.MOVIE, ContentType.SERIES)
+ }
+ val hasPendingOneTime = sections.any { section ->
stalkerIndexJobStore.get(provider.id, section)?.state in setOf(
StalkerIndexState.QUEUED,
StalkerIndexState.RUNNING,
diff --git a/data/src/main/java/com/streamvault/data/sync/StalkerIndexPolicy.kt b/data/src/main/java/com/streamvault/data/sync/StalkerIndexPolicy.kt
index 88f17439..d5404500 100644
--- a/data/src/main/java/com/streamvault/data/sync/StalkerIndexPolicy.kt
+++ b/data/src/main/java/com/streamvault/data/sync/StalkerIndexPolicy.kt
@@ -6,6 +6,7 @@ import com.streamvault.domain.model.CatalogLayout
import com.streamvault.domain.model.ContentType
import com.streamvault.domain.model.Movie
import com.streamvault.domain.model.Series
+import com.streamvault.domain.model.VodCatalogItem
import java.security.MessageDigest
/** Durable state projected into the decisions made by the Stalker index worker. */
@@ -218,8 +219,21 @@ internal object StalkerIndexPolicy {
contentType: ContentType,
visibleCategoryIds: Set<Long>?
): List<out Any> = when (contentType) {
- ContentType.MOVIE -> items.filterIsInstance<Movie>().filter { movie ->
- visibleCategoryIds == null || movie.categoryId in visibleCategoryIds
+ ContentType.MOVIE -> {
+ val classified = items.filterIsInstance<StalkerVodCatalogItem>()
+ if (classified.isNotEmpty()) {
+ classified.filter { entry ->
+ val categoryId = when (val item = entry.item) {
+ is VodCatalogItem.MovieItem -> item.movie.categoryId
+ is VodCatalogItem.SeriesItem -> item.series.categoryId
+ }
+ visibleCategoryIds == null || categoryId in visibleCategoryIds
+ }
+ } else {
+ items.filterIsInstance<Movie>().filter { movie ->
+ visibleCategoryIds == null || movie.categoryId in visibleCategoryIds
+ }
+ }
}
ContentType.SERIES -> items.filterIsInstance<Series>().filter { series ->
visibleCategoryIds == null || series.categoryId in visibleCategoryIds
diff --git a/data/src/main/java/com/streamvault/data/sync/SyncManager.kt b/data/src/main/java/com/streamvault/data/sync/SyncManager.kt
index af3264fb..ee49494c 100644
--- a/data/src/main/java/com/streamvault/data/sync/SyncManager.kt
+++ b/data/src/main/java/com/streamvault/data/sync/SyncManager.kt
@@ -254,9 +254,7 @@ class SyncManager @Inject constructor(
private val stalkerIndexContinuationCoordinator by lazy {
StalkerIndexContinuationCoordinator(
stalkerIndexJobStore = stalkerIndexJobStore,
- loadCategories = { providerId, contentType ->
- categoryDao.getByProviderAndTypeSync(providerId, contentType.name)
- },
+ loadCategories = ::stalkerIndexCategoriesForSection,
loadHydration = stalkerIndexCheckpointStore::getHydrationSnapshot,
visibleCategories = { providerId, contentType, categories, api ->
visibleStalkerIndexCategories(
@@ -290,13 +288,7 @@ class SyncManager @Inject constructor(
operations = CallbackStalkerIncrementalIndexOperations(
StalkerIncrementalIndexCallbacks(
runtimeProfile = { CatalogSyncRuntimeProfile.from(applicationContext) },
- allVisibleCategories = { providerId, contentType ->
- allVisibleStalkerIndexCategories(
- providerId = providerId,
- contentType = contentType,
- categories = categoryDao.getByProviderAndTypeSync(providerId, contentType.name)
- )
- },
+ allVisibleCategories = ::stalkerIndexCategoriesForSection,
visibleCategories = { contentType, categories, api ->
visibleStalkerIndexCategories(contentType, categories, api)
},
@@ -316,6 +308,7 @@ class SyncManager @Inject constructor(
fetchSummaryPage = { provider, api, contentType, categoryId, page ->
withStalkerFetchPermit(provider, contentType, categoryId, page) {
fetchStalkerSummaryPageWithRecovery(
+ provider = provider,
api = api,
contentType = contentType,
categoryId = categoryId,
@@ -326,7 +319,7 @@ class SyncManager @Inject constructor(
},
fetchWildcardPage = { provider, api, contentType, categoryId, page ->
withStalkerFetchPermit(provider, contentType, categoryId, page) {
- fetchStalkerWildcardSummaryPageWithRecovery(api, contentType, categoryId, page)
+ fetchStalkerWildcardSummaryPageWithRecovery(provider, api, contentType, categoryId, page)
}
},
markAttemptStarted = { providerId, contentType, categoryId, hydration, attemptedPage, now ->
@@ -1813,6 +1806,7 @@ class SyncManager @Inject constructor(
}
private suspend fun fetchStalkerSummaryPageWithRecovery(
+ provider: Provider,
api: StalkerProvider,
contentType: ContentType,
categoryId: Long,
@@ -1820,6 +1814,9 @@ class SyncManager @Inject constructor(
splitVod: Boolean = false
): Result<com.streamvault.data.remote.stalker.StalkerPagedResult<out Any>> {
suspend fun fetch(): Result<com.streamvault.data.remote.stalker.StalkerPagedResult<out Any>> {
+ if (contentType == ContentType.MOVIE && provider.catalogLayout == CatalogLayout.UNIFIED_VOD) {
+ return api.getUnifiedVodPage(categoryId, page)
+ }
if (splitVod && contentType == ContentType.MOVIE) {
val seriesCategoryId = api.projectVodCategoryToSeries(categoryId)
?: return Result.error("Unable to resolve VOD-derived Series category")
@@ -1863,19 +1860,26 @@ class SyncManager @Inject constructor(
}
private suspend fun fetchStalkerWildcardSummaryPageWithRecovery(
+ provider: Provider,
api: StalkerProvider,
contentType: ContentType,
categoryId: Long,
page: Int
): Result<com.streamvault.data.remote.stalker.StalkerPagedResult<out Any>> {
- val initial = fetchStalkerWildcardSummaryPage(api, contentType, categoryId, page)
+ suspend fun fetch(): Result<com.streamvault.data.remote.stalker.StalkerPagedResult<out Any>> =
+ if (contentType == ContentType.MOVIE && provider.catalogLayout == CatalogLayout.UNIFIED_VOD) {
+ api.getUnifiedVodPage(categoryId, page)
+ } else {
+ fetchStalkerWildcardSummaryPage(api, contentType, categoryId, page)
+ }
+ val initial = fetch()
if (initial is Result.Error && StalkerIndexRecoveryPolicy.isLikelyAuthFailure(initial.message, initial.exception)) {
Log.w(
TAG,
"Retrying Stalker wildcard ${contentType.name} page $page after auth refresh for category $categoryId"
)
api.invalidateAuthentication()
- return fetchStalkerWildcardSummaryPage(api, contentType, categoryId, page)
+ return fetch()
}
return initial
}
@@ -1944,6 +1948,23 @@ class SyncManager @Inject constructor(
}
}
+ private suspend fun stalkerIndexCategoriesForSection(
+ providerId: Long,
+ section: ContentType
+ ): List<CategoryEntity> {
+ val catalogLayout = providerSnapshotRepository?.getSnapshot(providerId)?.accountRuntime?.catalogLayout
+ ?: loadCompatibilityProvider(providerId)?.catalogLayout
+ val categoryType = if (
+ section == ContentType.MOVIE &&
+ catalogLayout == CatalogLayout.UNIFIED_VOD
+ ) ContentType.VOD else section
+ return allVisibleStalkerIndexCategories(
+ providerId = providerId,
+ contentType = categoryType,
+ categories = categoryDao.getByProviderAndTypeSync(providerId, categoryType.name)
+ )
+ }
+
private suspend fun visibleStalkerIndexCategories(
contentType: ContentType,
categories: List<CategoryEntity>,
@@ -1951,7 +1972,7 @@ class SyncManager @Inject constructor(
): List<CategoryEntity> {
val visible = categories
if (visible.isEmpty()) return emptyList()
- val normalCategories = visible.filterNot { category -> api.isWildcardCategory(contentType, category.categoryId) }
+ val normalCategories = visible.filterNot { category -> api.isWildcardCategory(category.type, category.categoryId) }
return if (normalCategories.isNotEmpty()) normalCategories else visible
}
diff --git a/data/src/test/java/com/streamvault/data/remote/stalker/OkHttpStalkerApiServiceTest.kt b/data/src/test/java/com/streamvault/data/remote/stalker/OkHttpStalkerApiServiceTest.kt
index 55661d4c..5c19a41a 100644
--- a/data/src/test/java/com/streamvault/data/remote/stalker/OkHttpStalkerApiServiceTest.kt
+++ b/data/src/test/java/com/streamvault/data/remote/stalker/OkHttpStalkerApiServiceTest.kt
@@ -1925,6 +1925,40 @@ class OkHttpStalkerApiServiceTest {
assertThat(page.isTruncated).isFalse()
}
+ @Test
+ fun getVodStreamsPageAtPortalPage_preserves_zero_based_probe_cursor() = runTest {
+ var requestedPage: String? = null
+ val service = OkHttpStalkerApiService(
+ okHttpClient = OkHttpClient.Builder()
+ .addInterceptor { chain ->
+ requestedPage = chain.request().url.queryParameter("p")
+ Response.Builder()
+ .request(chain.request())
+ .protocol(Protocol.HTTP_1_1)
+ .code(200)
+ .message("OK")
+ .body(
+ """{"js":{"total_items":2,"max_page_items":1,"data":[{"id":"1","name":"First movie","category_id":"42","cmd":"ffmpeg http://example.com/movie.mp4"}]}}"""
+ .toResponseBody("application/json".toMediaType())
+ )
+ .build()
+ }
+ .build(),
+ json = Json { ignoreUnknownKeys = true }
+ )
+
+ val result = service.getVodStreamsPageAtPortalPage(
+ stalkerSession(),
+ stalkerProfile(),
+ categoryId = "42",
+ portalPage = 0
+ )
+
+ assertThat(result).isInstanceOf(Result.Success::class.java)
+ assertThat(requestedPage).isEqualTo("0")
+ assertThat((result as Result.Success).data.page).isEqualTo(0)
+ }
+
@Test
fun getVodFiles_requests_movie_files_by_movie_id() = runTest {
var requestedMovieId: String? = null
diff --git a/data/src/test/java/com/streamvault/data/remote/stalker/StalkerPortalStateStoreTest.kt b/data/src/test/java/com/streamvault/data/remote/stalker/StalkerPortalStateStoreTest.kt
index 2091f40c..29355493 100644
--- a/data/src/test/java/com/streamvault/data/remote/stalker/StalkerPortalStateStoreTest.kt
+++ b/data/src/test/java/com/streamvault/data/remote/stalker/StalkerPortalStateStoreTest.kt
@@ -17,6 +17,23 @@ import org.junit.Test
import java.util.Base64
class StalkerPortalStateStoreTest {
+ @Test
+ fun `VOD page base is persisted and isolated by configuration generation`() = runTest {
+ val store = StalkerPortalStateStore(FakePortalStateDao(), TestCredentialCrypto())
+
+ store.recordVodPageBase(providerId = 42L, pageBase = 0, configurationGeneration = 7L)
+
+ assertThat(store.getVodPageBase(providerId = 42L, configurationGeneration = 7L)).isEqualTo(0)
+ assertThat(store.getVodPageBase(providerId = 42L, configurationGeneration = 8L)).isNull()
+ val learning = Json.parseToJsonElement(requireNotNull(store.get(42L)).learningJson).jsonObject
+ assertThat(learning.getValue("vodPageBase").jsonObject.getValue("source").jsonPrimitive.content)
+ .isEqualTo("CATALOG")
+
+ store.recordVodPageBase(providerId = 42L, pageBase = 1, configurationGeneration = 7L)
+ assertThat(store.getVodPageBase(providerId = 42L, configurationGeneration = 7L)).isEqualTo(1)
+ assertThat(store.getVodPageBase(providerId = 42L, configurationGeneration = 8L)).isNull()
+ }
+
@Test
fun `rate limit cooldown is persisted independently and can be cleared`() = runTest {
val dao = FakePortalStateDao()
diff --git a/data/src/test/java/com/streamvault/data/remote/stalker/StalkerProviderTest.kt b/data/src/test/java/com/streamvault/data/remote/stalker/StalkerProviderTest.kt
index e0b8fe26..e1a96b60 100644
--- a/data/src/test/java/com/streamvault/data/remote/stalker/StalkerProviderTest.kt
+++ b/data/src/test/java/com/streamvault/data/remote/stalker/StalkerProviderTest.kt
@@ -1084,6 +1084,78 @@ class StalkerProviderTest {
assertThat(movie.categoryName).isEqualTo("Action")
}
+ @Test
+ fun vodPaging_detectsZeroBasedPortalAndPersistsOffsetAcrossProviderInstances() = runTest {
+ val dao = FakePortalStateDao()
+ val store = StalkerPortalStateStore(dao, TestCredentialCrypto())
+ val api = FakeStalkerApiService(
+ profile = StalkerProviderProfile(accountName = "Room"),
+ vodPageResultsByPage = mapOf(
+ 0 to stalkerVodPage(0, "zero-first", "First page"),
+ 1 to stalkerVodPage(1, "zero-second", "Second page"),
+ 2 to stalkerVodPage(2, "zero-third", "Third page")
+ )
+ )
+ fun provider() = StalkerProvider(
+ providerId = 47L,
+ api = api,
+ portalUrl = "https://portal.example.com/c/",
+ macAddress = "00:1A:79:12:34:56",
+ deviceProfile = "MAG250",
+ timezone = "UTC",
+ locale = "en",
+ configurationGeneration = 9L,
+ portalStateStore = store
+ )
+
+ val first = provider().getVodStreamsPage(categoryId = null, page = 1) as Result.Success
+ assertThat(first.data.items.single().name).isEqualTo("First page")
+ assertThat(first.data.page).isEqualTo(1)
+ assertThat(api.vodPageRequests).containsExactly(0, 1).inOrder()
+ assertThat(store.getVodPageBase(47L, 9L)).isEqualTo(0)
+
+ val resumed = provider().getVodStreamsPage(categoryId = null, page = 2) as Result.Success
+ assertThat(resumed.data.items.single().name).isEqualTo("Second page")
+ assertThat(resumed.data.page).isEqualTo(2)
+ assertThat(api.vodPageRequests).containsExactly(0, 1, 1).inOrder()
+ assertThat(api.authenticateCalls).isEqualTo(1)
+ }
+
+ @Test
+ fun vodPaging_detectsOneBasedPortalWhenPageZeroAliasesPageOne() = runTest {
+ val api = FakeStalkerApiService(
+ profile = StalkerProviderProfile(accountName = "Room"),
+ vodPageResultsByPage = mapOf(
+ 0 to stalkerVodPage(0, "one-first", "First page"),
+ 1 to stalkerVodPage(1, "one-first", "First page"),
+ 2 to stalkerVodPage(2, "one-second", "Second page")
+ )
+ )
+ val provider = categoryReuseProvider(api)
+
+ val first = provider.getVodStreamsPage(categoryId = null, page = 1) as Result.Success
+ val second = provider.getVodStreamsPage(categoryId = null, page = 2) as Result.Success
+
+ assertThat(first.data.items.single().name).isEqualTo("First page")
+ assertThat(second.data.items.single().name).isEqualTo("Second page")
+ assertThat(api.vodPageRequests).containsExactly(0, 1, 2).inOrder()
+ }
+
+ private fun stalkerVodPage(page: Int, id: String, title: String) = StalkerPagedItems(
+ items = listOf(
+ StalkerItemRecord(
+ id = id,
+ name = title,
+ cmd = "ffmpeg http://cdn.example.com/$id.mp4"
+ )
+ ),
+ page = page,
+ totalPages = 3,
+ pageSize = 1,
+ advertisedTotalItems = 3,
+ advertisedTotalPages = 3
+ )
+
@Test
fun getSeriesListPage_preservesRequestedCategoryWhenOnlyReverseIdentityIsCached() = runTest {
val resolver = StalkerRemoteIdentityResolver(FakeIdentityDao(), DirectTransactionRunner)
@@ -1840,8 +1912,9 @@ class StalkerProviderTest {
private val authenticationError: Throwable? = null,
private val vodFiles: List<StalkerItemRecord> = emptyList(),
private val vodFilesResult: Result<List<StalkerItemRecord>>? = null,
- private val createLinkResultsByCmd: Map<String, Result<String>> = emptyMap()
- ) : StalkerApiService {
+ private val createLinkResultsByCmd: Map<String, Result<String>> = emptyMap(),
+ private val vodPageResultsByPage: Map<Int, StalkerPagedItems> = emptyMap()
+ ) : StalkerApiService, StalkerRawVodPageApi {
var createLinkCalls: Int = 0
private set
var seriesCategoryCalls: Int = 0
@@ -1855,6 +1928,7 @@ class StalkerProviderTest {
val shortEpgCalls: MutableList<String> = mutableListOf()
val epgCalls: MutableList<String> = mutableListOf()
val vodFileLookupCalls: MutableList<String> = mutableListOf()
+ val vodPageRequests: MutableList<Int> = mutableListOf()
val createLinkCmds: MutableList<String> = mutableListOf()
var lastVodSearchQuery: String? = null
@@ -1916,7 +1990,11 @@ class StalkerProviderTest {
profile: StalkerDeviceProfile,
categoryId: String?,
page: Int
- ) = Result.success(StalkerPagedItems(vodPageItems, page, page, vodPageItems.size))
+ ): Result<StalkerPagedItems> {
+ vodPageRequests += page
+ return Result.success(vodPageResultsByPage[page]?.copy(page = page)
+ ?: StalkerPagedItems(vodPageItems, page, page, vodPageItems.size))
+ }
override suspend fun getVodStreamsPage(
session: StalkerSession,
@@ -1926,7 +2004,21 @@ class StalkerProviderTest {
searchQuery: String?
) = run {
lastVodSearchQuery = searchQuery
- Result.success(StalkerPagedItems(vodPageItems, page, page, vodPageItems.size))
+ vodPageRequests += page
+ Result.success(vodPageResultsByPage[page]?.copy(page = page)
+ ?: StalkerPagedItems(vodPageItems, page, page, vodPageItems.size))
+ }
+
+ override suspend fun getVodStreamsPageAtPortalPage(
+ session: StalkerSession,
+ profile: StalkerDeviceProfile,
+ categoryId: String?,
+ portalPage: Int,
+ searchQuery: String?
+ ): Result<StalkerPagedItems> = if (searchQuery == null) {
+ getVodStreamsPage(session, profile, categoryId, portalPage)
+ } else {
+ getVodStreamsPage(session, profile, categoryId, portalPage, searchQuery)
}
override suspend fun getVodFiles(
diff --git a/data/src/test/java/com/streamvault/data/repository/SearchRepositoryImplTest.kt b/data/src/test/java/com/streamvault/data/repository/SearchRepositoryImplTest.kt
index 8089021b..34e9d89d 100644
--- a/data/src/test/java/com/streamvault/data/repository/SearchRepositoryImplTest.kt
+++ b/data/src/test/java/com/streamvault/data/repository/SearchRepositoryImplTest.kt
@@ -34,7 +34,9 @@ class SearchRepositoryImplTest {
movieRepository = movieRepository,
seriesRepository = seriesRepository,
providerDao = mock(),
- stalkerIndexJobDao = mock()
+ stalkerIndexJobDao = mock(),
+ providerSnapshotDao = mock(),
+ vodRepository = mock()
)
@Test
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 96afc31f..1c0e6f4d 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -10,8 +10,10 @@ All notable product changes are recorded in this document.
### Fixed
- QR pairing now routes Xtream `get.php` URLs with embedded credentials through the same URL setup flow as manual entry.
-- QR pairing now reports provider-specific setup errors in the web flow and handles Stalker TV review prompts through the native setup dialogs.
+- QR pairing now shows provider-specific setup errors, and presents Stalker transport or verification review as a continue-on-TV state with native setup dialogs.
- Fixed aspect ratio button causing crash in VOD.
+- Fixed provider observation and switching crashes on devices where saved credentials cannot be decrypted by using redacted provider projections and returning credential errors from guide fallback requests.
+- Fixed credential encryption fallback changing key sources after an update: an existing software key remains preferred, encryption retries with the alternate key when either cipher fails, and provider credentials recovered through the alternate key are re-encrypted with the preferred key.
- Fixed Settings Sync Now for Xtream providers so movie and series indexing is not cancelled by a competing section request, and progress remains visible until indexing finishes.
- Fixed automatic sync for existing providers after upgrade: catalogs that predate the updated sync engine are caught up, and overdue checks are requested when the app opens or returns to the foreground.
- Fixed scheduled index work when sync policies change, pending Live sections, and rebuilding an index for all provider sections.
@@ -57,8 +59,6 @@ All notable product changes are recorded in this document.
- Fixed QR provider pairing session cleanup and request validation, including expired sessions, malformed or oversized submissions, slow clients, and duplicate submissions.
- Fixed the VOD playback settings sheet remaining visible over picture-in-picture playback.
- Fixed live channels in custom groups showing **Add** instead of **Remove** in the channel options dialog.
-- Fixed provider observation crashes on devices where saved credentials cannot be decrypted by skipping unnecessary credential decryption in public provider projections.
-- Fixed credential encryption fallback changing key sources after an update: an existing software key remains preferred, legacy credentials can be decrypted with either available key, and failed hardware cipher operations retry with the software key.
- Fixed successful new-provider setup staying on Add Provider; new providers now navigate to Home, while edits return to the previous screen.
- Fixed repeated stream restarts during network outages and unnecessary recovery from nonfatal audio errors.
- Fixed stalled live playback recovery to refresh the live window without interrupting active network retries.
diff --git a/docs/stalker-vod-catalog-investigation.md b/docs/stalker-vod-catalog-investigation.md
new file mode 100644
index 00000000..8bf1722a
--- /dev/null
+++ b/docs/stalker-vod-catalog-investigation.md
@@ -0,0 +1,142 @@
+# Stalker VOD: complete catalog investigation
+
+Date: 2026-10-19
+
+## Recommendation
+
+Automatically build a durable local index of all accessible VOD **summaries**, including unified movie/series portals. Make the provider usable after initial category loading, keep adding titles independently of browsing, and search the portal while the local index is incomplete. Fetch expensive details, episode lists, artwork bytes, and playback links when needed.
+
+Extend the existing index infrastructure. Changing the default from `ON_DEMAND` to `BACKGROUND_INDEX` alone will not deliver this behavior for unified VOD.
+
+“All” means the catalog available to the authenticated account, subject to the user's visibility and parental controls. Completion must describe verified coverage, not merely a successful category refresh.
+
+## Implementation update
+
+The recommended first implementation is now in the working tree:
+
+- New Stalker setups default to `BACKGROUND_INDEX`; existing saved modes are preserved.
+- Unified VOD categories now feed the durable Movie index job through `getUnifiedVodPage()`. The job keeps each row's movie/series classification and writes both movie summaries and VOD-derived series summaries.
+- Unified providers use only the Movie index job for progress, completion, manual rebuilds, startup recovery, and automatic freshness planning. The old separate Series job is ignored for unified layouts.
+- Global search merges local FTS results with portal-wide VOD search while coverage is incomplete, respecting the selected movie/series scope and keeping local matches available when the portal request fails.
+- The setup copy is localized in all 38 advertised locales.
+
+The implementation deliberately reuses the existing resumable page indexer and portal search API. It does not yet add adaptive pacing or a new all-movies browsing screen. Existing providers that saved `ON_DEMAND` keep that choice; they can still find uncached VOD via global search, and can opt into background indexing in provider settings.
+
+## Baseline before this work
+
+| Area | Current implementation | Consequence |
+| --- | --- | --- |
+| Default | `StalkerCatalogMode.ON_DEMAND` in provider configuration, setup state, and add-provider input | Most users start with category shells and progressively cached items. |
+| Existing alternative | Setup Advanced options offer `Complete background index` | There is already a product setting and a durable worker to build on. |
+| Split catalogs | Movie/series index jobs, per-category page checkpoints, retries, WorkManager continuations, summary upserts, and generation-fenced writes | Much of the required infrastructure exists. |
+| Unified VOD refresh | `StalkerCatalogSectionExecutor.syncMovies()` takes the lazy path when `unified`, even if `indexCatalog` is true | A unified refresh does not queue the full item index. |
+| Unified full sync | `StalkerCatalogSyncExecutor` stores `ContentType.VOD` categories and excludes unified catalogs from movie index queue setup | The full-sync path has the same coverage gap. |
+| Worker category reads | Continuation and incremental executor callbacks read `MOVIE`/`SERIES` categories; the job store only accepts those sections | Scheduling the existing worker alone does not make it consume unified `VOD` categories or update unified browse receipts. |
+| VOD category browsing | `VodRepositoryImpl` requests `OPEN`, prefetches one `NEXT_PAGE` in paged mode, and can request `COMPLETE` | Loading remains driven by visible shelves and opened categories. |
+| Complete-on-open | Unified category hydration limits one COMPLETE request to 200 pages and records truncated coverage when more remain | It is a bounded interactive operation, not a durable whole-library index. The single-page API itself can fetch page 201 and later. |
+| VOD search | `VodRepositoryImpl.searchVod()` calls the portal, persists stable IDs, and returns mixed movie/series pages; preference defaults to enabled | Users can already find uncached titles from this surface on portals that support search. |
+| Global search | `SearchRepositoryImpl` queries local FTS, with local section-query fallback | Unloaded titles are absent. Portal search on the VOD screen does not make global search complete. |
+| Wildcard strategy | Split indexing prefers explicit categories; wildcard paging is used when only the wildcard category remains and support is not known false | The app does not currently use a verified whole-catalog wildcard as the general fast path. |
+
+Key code locations:
+
+- `domain/src/main/java/com/streamvault/domain/model/Provider.kt`
+- `feature/provider/src/main/java/com/streamvault/feature/provider/setup/ProviderSetupAdvancedOptions.kt`
+- `data/src/main/java/com/streamvault/data/sync/StalkerCatalogSectionExecutor.kt`
+- `data/src/main/java/com/streamvault/data/sync/StalkerCatalogSyncExecutor.kt`
+- `data/src/main/java/com/streamvault/data/sync/StalkerIndexContinuationCoordinator.kt`
+- `data/src/main/java/com/streamvault/data/sync/StalkerIncrementalIndexExecutor.kt`
+- `data/src/main/java/com/streamvault/data/sync/SyncManager.kt`
+- `data/src/main/java/com/streamvault/data/sync/VodCategoryHydrationCoordinator.kt`
+- `data/src/main/java/com/streamvault/data/repository/VodRepositoryImpl.kt`
+- `data/src/main/java/com/streamvault/data/repository/SearchRepositoryImpl.kt`
+
+## Why a complete crawl can be slow
+
+`StalkerRequestCoordinator` allows one active `BACKGROUND_INDEX` operation per provider and applies a **5,000 ms** interval to background HTTP requests. `OkHttpStalkerApiService.withTransportAwareStalkerCall()` maps background indexing to that network priority. The incremental executor also adds inter-page delays of 1 second normally or 2 seconds during playback, and yields after a four-minute section run.
+
+The executor's maximum of two parallel category fetches therefore does not imply two simultaneous background requests. Raising that constant alone will not bypass network admission.
+
+Illustrative estimates for a portal returning 14 rows per page, an uninterrupted background crawl, and no competing traffic:
+
+| Raw catalog rows | Required pages | Time from five-second request spacing alone |
+| ---: | ---: | ---: |
+| 10,000 | 715 | About 60 minutes |
+| 50,000 | 3,572 | About 5 hours |
+
+These are calculations, not measurements of the user's portal. Category rounding, metadata requests, retries, idle restrictions, and continuation scheduling can add time. Page size is provider-controlled and may differ.
+
+## What external implementations show
+
+There is a bulk-style option on some portals, but it is still paginated rather than a single response containing the whole library. The `get_ordered_list` request can omit its category filter; some clients use that form for an unfiltered catalog listing, while others use a category or search filter. This is not a guarantee that every Stalker portal treats an omitted VOD category as “all.”
+
+The app's HTTP service can omit the `category` query parameter, and `StalkerProvider` exposes nullable-category VOD page methods. The background indexer currently walks explicit categories page by page; it does not make one request for the whole library. Requests reuse the provider's cached authenticated session, so this is not a new authentication handshake for every page. A category-less listing could reduce request count on some portals, but before using it as the index source the app must verify that it covers the visible catalog, preserves real category IDs, and advances without repeating or truncating; otherwise it must keep category-by-category paging.
+
+The available external sources support paged enumeration and portal search; they do not establish a universal single-request VOD export. Infomir's published REST API v1 page documents its administrative REST resources, not the legacy STB `get_ordered_list` endpoint, so the portal request contract is established mainly through client implementations and must still be checked against the user's portal.
+
+- [stalkerhek's VOD implementation](https://github.com/kidpoleon/stalkerhek/blob/main/stalker/vod.go) implements full movie loading by walking ordered-list pages, and native-series loading with a VOD-series fallback.
+- [iptv-m3u-reader's Stalker implementation](https://github.com/DimitarCC/iptv-m3u-reader/blob/main/src/StalkerProvider.py) sends `type=vod&action=get_ordered_list`, optionally with category and search, and derives continuation from `total_items` and `max_page_items`.
+- [ynotv's Stalker client](https://github.com/tbeezy/ynotv/blob/main/packages/local-adapter/src/stalker-client.ts) explicitly handles portal page-numbering differences, bounded page walks, and detection of portals that ignore search. This is compatibility evidence from another client, not a guarantee about every portal.
+- [Thunder TV's own architecture document](https://github.com/D-dezeeuw/thunder-tv/blob/master/docs/architecture/stalker-portal.md) confines its bulk `get_all_channels` cache to ITV and retains server-side VOD/series search. Its live-TV shortcut should not be assumed to enumerate movies.
+- [Infomir's REST API v1 documentation](https://wiki.infomir.eu/eng/ministra-tv-platform/ministra-setup-guide/rest-api-v1) describes separately authenticated management/integration resources. It does not establish a bulk VOD endpoint usable with the app's existing MAC/token session.
+
+Inference: the portable solution is resumable ordered-list indexing plus server search. A provider-specific bulk API could be an optional optimization only after capability and authorization checks.
+
+## Remaining design considerations
+
+### Unified VOD indexing details
+
+The current implementation reuses the existing Movie job as the unified VOD index section. A future schema-level unified job could make the distinction more explicit, but is not required for the existing worker and search completeness to represent unified coverage.
+
+Use `getUnifiedVodPage()` so each raw row retains its movie/series classification. Reuse the page-commit logic behind interactive hydration, after extracting a shared commit operation: persist movie/series summaries, `VodCatalogEntryEntity` page order, protection state, and the page checkpoint together. Apply the active workflow generation fence and coordinate with interactive category hydration so they cannot overwrite each other's progress.
+
+Keep work bounded by page/time slices. A slice limit means continuation from the last committed page, rather than terminal catalog truncation. Preserve cached rows while refreshing. Prune only after verified complete coverage of the relevant category or generation; failed or anomalous scopes retain their previous content.
+
+### Background indexing and browsing
+
+Initial setup still finishes after usable category/live data; the index continues without opening categories. Existing users' explicitly selected modes remain unchanged.
+
+Expose the whole local movie library through paged database queries and a windowed grid. Summary indexing should not trigger per-title details, episode expansion, image downloads, or `create_link` requests. Provider row counts and deduplicated displayed movie counts must remain distinct.
+
+Show indexed count, coverage state, and actionable retry status. Derive unified search completeness from the unified ingestion job. Category-list freshness and full item-coverage freshness must be separate, since today's lazy refresh can succeed without enumerating items.
+
+Any new or edited product wording must use owning-module resources and real translations in every locale advertised by `locales_config.xml`.
+
+### Global search during the initial crawl
+
+Return local FTS results immediately. While coverage is incomplete, also request portal search and merge results by provider identity. The current implementation retains the existing Flow cancellation behavior and paging, and relies on `VodRepository` for visibility filtering and persistence.
+
+Track portal-search capability, including ignored search parameters. Failure or unsupported search must leave local results visible and the coverage state accurate. Validate native-series versus VOD-derived-series search according to the learned catalog layout. A portal search result does not certify that the local catalog is complete.
+
+### 4. Use category-less catalog paging only where the portal proves support
+
+Probe whether category-less or wildcard/all-category paging covers the accessible catalog, preserves category identity, and advances correctly. Prefer it when validated; otherwise crawl explicit categories. A non-empty first page is insufficient evidence of complete coverage.
+
+Page numbering also varies across portals. The app keeps 1-based logical page checkpoints, probes `p=0` and `p=1` on the first VOD page using the same authenticated session, and maps subsequent requests to the detected portal offset. It persists the offset in the existing generation-fenced provider learning state, so resumed indexing keeps the same sequence without repeating the probe. A transient failure on `p=0` fails that page instead of silently treating page two as page one. This follows the compatibility approach in [ynotv's client](https://github.com/tbeezy/ynotv/blob/main/packages/local-adapter/src/stalker-client.ts); the actual offset still needs to be observed on each target portal, and unstable totals or repeated pages must never be treated as proof of complete coverage.
+
+Learn paging behavior where necessary; current single-page requests clamp to page 1 and higher. Detect repeated/non-advancing pages across continuations, premature empties, changed totals, and missing totals. Do not mark these outcomes complete.
+
+Retain the present request coordinator initially. Measure latency, unique rows per second, 429s, timeouts, and interactive delays. Then replace the fixed five-second interval with provider-scoped adaptive pacing: cautiously shorten intervals after sustained healthy responses, slow down on stress, preserve Retry-After and cooldowns, and keep playback/link resolution ahead of indexing. Keep the existing concurrency limits until measurements justify changing them.
+
+## Validation and evidence
+
+The research pass was source inspection only; no provider credentials were read and no production portal was queried. External clients demonstrate compatibility approaches, not the capabilities of the user's specific provider. The page-offset fix is validated with simulated zero-based and one-based portals; it has not been observed against the user's actual portal.
+
+Executed:
+
+```powershell
+.\gradlew.bat :data:testDebugUnitTest --tests com.streamvault.data.remote.stalker.StalkerProviderTest --tests com.streamvault.data.remote.stalker.StalkerPortalStateStoreTest --tests com.streamvault.data.remote.stalker.OkHttpStalkerApiServiceTest --tests com.streamvault.data.repository.MovieRepositoryImplTest --tests com.streamvault.data.repository.SeriesRepositoryImplTest --tests com.streamvault.data.sync.SyncManagerTest --tests com.streamvault.data.provider.ProviderConfigurationCodecTest --tests com.streamvault.data.provider.RoomProviderSnapshotRepositoryTest --tests com.streamvault.data.security.CredentialCryptoTest
+```
+
+Latest result: **344 tests passed**, zero failures, errors, or skips. `git diff --check` also passed. Earlier baseline runs covered additional indexing and repository test classes; resource validation confirmed all six added setup strings exist in each of the 38 advertised locales.
+
+Further validation should demonstrate:
+
+1. On fresh unified and split providers, a title near the end of an unopened category becomes searchable through background indexing.
+2. Mixed movie/series categories retain every correctly classified item and provider ordering; movies-only views include standalone movies in mixed categories.
+3. A category beyond 200 pages completes through durable continuation. Process death and a failed page resume without losing or skipping committed coverage.
+4. On the actual portal, confirm the detected page base and verify that unsupported wildcard/search, repeated pages, missing totals, changing totals, and early empty pages never produce false completion or destructive pruning.
+5. Search while indexing merges stable IDs, honors hidden/protected content, and remains useful when the portal is offline.
+6. Refresh discovers additions and handles removals only after proven coverage. Configuration changes reject stale writes; simultaneous category opening cannot corrupt checkpoints.
+7. Record actual portal page size, requests, unique rows, elapsed time, retries/429s, memory use, and search latency on a low-memory TV/emulator before changing pacing defaults.
+8. If pacing changes affect live playback, perform the repository's full multi-channel screenshot/log validation rather than relying on build or launch success.
diff --git a/domain/src/main/java/com/streamvault/domain/usecase/ValidateAndAddProvider.kt b/domain/src/main/java/com/streamvault/domain/usecase/ValidateAndAddProvider.kt
index c896e051..003396ca 100644
--- a/domain/src/main/java/com/streamvault/domain/usecase/ValidateAndAddProvider.kt
+++ b/domain/src/main/java/com/streamvault/domain/usecase/ValidateAndAddProvider.kt
@@ -79,7 +79,7 @@ data class StalkerProviderSetupCommand(
val repairConnection: Boolean = false,
val requestedProfileId: String = StalkerCompatibilityProfileIds.AUTO,
val epgSyncMode: ProviderEpgSyncMode = ProviderEpgSyncMode.BACKGROUND,
- val catalogMode: StalkerCatalogMode = StalkerCatalogMode.ON_DEMAND,
+ val catalogMode: StalkerCatalogMode = StalkerCatalogMode.BACKGROUND_INDEX,
val guideSourcePolicy: GuideSourcePolicy = GuideSourcePolicy.AUTO,
val channelLogoSourcePolicy: ChannelLogoSourcePolicy = ChannelLogoSourcePolicy.SUPPLIER_PREFERRED,
val existingProviderId: Long? = null
diff --git a/feature/provider/src/main/java/com/streamvault/feature/provider/pairing/ProviderQrPairingManager.kt b/feature/provider/src/main/java/com/streamvault/feature/provider/pairing/ProviderQrPairingManager.kt
index f6421364..96092488 100644
--- a/feature/provider/src/main/java/com/streamvault/feature/provider/pairing/ProviderQrPairingManager.kt
+++ b/feature/provider/src/main/java/com/streamvault/feature/provider/pairing/ProviderQrPairingManager.kt
@@ -339,7 +339,7 @@ class ProviderQrPairingManager @Inject constructor(
command = result.command,
challenge = result.challenge,
)
- writeHtml(client.getOutputStream(), 400, errorPage(phoneContext, result.details))
+ writeHtml(client.getOutputStream(), 200, continuationPage(phoneContext, result.details))
}
is ProviderPairingSubmitResult.StalkerVerificationInconclusive -> {
@@ -349,7 +349,7 @@ class ProviderQrPairingManager @Inject constructor(
command = result.command,
verificationInconclusive = result.verificationMessage,
)
- writeHtml(client.getOutputStream(), 400, errorPage(phoneContext, result.details))
+ writeHtml(client.getOutputStream(), 200, continuationPage(phoneContext, result.details))
}
is ProviderPairingSubmitResult.Failed -> {
@@ -896,6 +896,15 @@ class ProviderQrPairingManager @Inject constructor(
private fun errorPage(strings: Context, details: String? = null): String =
resultPage(strings, success = false, details = details)
+ private fun continuationPage(strings: Context, details: String): String =
+ resultPage(
+ strings = strings,
+ success = false,
+ details = details,
+ titleResource = R.string.setup_phone_pairing_continue_on_tv,
+ pending = true,
+ )
+
private fun pageDirection(strings: Context): String =
if (strings.resources.configuration.layoutDirection == android.view.View.LAYOUT_DIRECTION_RTL) "rtl" else "ltr"
@@ -906,16 +915,36 @@ class ProviderQrPairingManager @Inject constructor(
</div>
""".trimIndent()
- private fun resultPage(strings: Context, success: Boolean, details: String? = null): String {
+ private fun resultPage(
+ strings: Context,
+ success: Boolean,
+ details: String? = null,
+ titleResource: Int? = null,
+ pending: Boolean = false,
+ ): String {
val title = strings.getString(
- if (success) R.string.setup_phone_pairing_complete else R.string.setup_phone_pairing_error,
+ titleResource ?: if (success) {
+ R.string.setup_phone_pairing_complete
+ } else {
+ R.string.setup_phone_pairing_error
+ },
).escapeHtml()
val hasDetails = !details.isNullOrBlank()
- val help = if (success || hasDetails) {
+ val help = if (success || pending || hasDetails) {
""
} else {
"<p>${strings.getString(R.string.setup_phone_pairing_error_help).escapeHtml()}</p>"
}
+ val resultKind = when {
+ success -> "success"
+ pending -> "pending"
+ else -> "failure"
+ }
+ val icon = when {
+ success -> "&#10003;"
+ pending -> "&#8230;"
+ else -> "!"
+ }
val detailsHtml = details
?.trim()
?.takeIf(String::isNotEmpty)
@@ -927,8 +956,8 @@ class ProviderQrPairingManager @Inject constructor(
<meta name="color-scheme" content="dark"><meta name="theme-color" content="#0b0e14">
<title>$title</title><style>${pageStyles()}</style></head>
<body><main>${pageBrand(strings)}
- <section class="form-card result" role="${if (success) "status" else "alert"}">
- <span class="result-icon ${if (success) "success" else "failure"}" aria-hidden="true">${if (success) "&#10003;" else "!"}</span>
+ <section class="form-card result" role="${if (success || pending) "status" else "alert"}">
+ <span class="result-icon $resultKind" aria-hidden="true">$icon</span>
<h1>$title</h1>$detailsHtml$help
</section>
</main></body></html>
@@ -981,6 +1010,7 @@ class ProviderQrPairingManager @Inject constructor(
.result{text-align:center;padding:48px 28px}.result p{max-width:420px;margin:0 auto 14px}.result .result-detail{color:#e8eaf2;white-space:pre-line;overflow-wrap:anywhere}.result .result-detail:last-of-type{margin-bottom:20px}
.result-icon{display:grid;place-items:center;width:64px;height:64px;margin:0 auto 24px;border-radius:50%;font-size:30px}
.success{color:#9cd6bc;background:#9cd6bc12;border:1px solid #9cd6bc40}
+ .pending{color:#c4b5f6;background:#c4b5f612;border:1px solid #c4b5f640}
.failure{color:#e6ad9b;background:#e6ad9b12;border:1px solid #e6ad9b40}
@media(max-width:480px){body{padding:28px 20px}.brand{margin-bottom:34px}.source-section{padding:20px}.details-section{padding:4px 20px}.submit-section{padding:22px 20px}.credentials-row{grid-template-columns:1fr;gap:0}.form-card{border-radius:18px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
diff --git a/feature/provider/src/main/java/com/streamvault/feature/provider/setup/ProviderSetupAdvancedOptions.kt b/feature/provider/src/main/java/com/streamvault/feature/provider/setup/ProviderSetupAdvancedOptions.kt
index c15a5681..4fd5b324 100644
--- a/feature/provider/src/main/java/com/streamvault/feature/provider/setup/ProviderSetupAdvancedOptions.kt
+++ b/feature/provider/src/main/java/com/streamvault/feature/provider/setup/ProviderSetupAdvancedOptions.kt
@@ -12,6 +12,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
@@ -461,24 +462,24 @@ internal fun AdvancedProviderOptionsSection(
verticalArrangement = Arrangement.spacedBy(10.dp)
) {
Text(
- text = "Movie and series catalog",
+ text = stringResource(R.string.setup_stalker_catalog_title),
style = MaterialTheme.typography.titleSmall,
color = TextPrimary
)
Text(
- text = "This is separate from EPG loading. On demand makes the provider ready after categories load; background indexing downloads the complete catalog later.",
+ text = stringResource(R.string.setup_stalker_catalog_description),
style = MaterialTheme.typography.bodySmall,
color = OnSurfaceDim
)
PolicyOptionRow(
- title = "On demand (recommended)",
- description = "Load visible shelves and opened categories as needed. Existing cached items are kept.",
+ title = stringResource(R.string.setup_stalker_catalog_on_demand_title),
+ description = stringResource(R.string.setup_stalker_catalog_on_demand_description),
selected = uiState.stalkerCatalogMode == StalkerCatalogMode.ON_DEMAND,
onSelect = { onSelectStalkerCatalogMode(StalkerCatalogMode.ON_DEMAND) }
)
PolicyOptionRow(
- title = "Complete background index",
- description = "Make the provider ready first, then maintain a complete searchable catalog in the background.",
+ title = stringResource(R.string.setup_stalker_catalog_background_title),
+ description = stringResource(R.string.setup_stalker_catalog_background_description),
selected = uiState.stalkerCatalogMode == StalkerCatalogMode.BACKGROUND_INDEX,
onSelect = { onSelectStalkerCatalogMode(StalkerCatalogMode.BACKGROUND_INDEX) }
)
diff --git a/feature/provider/src/main/java/com/streamvault/feature/provider/setup/ProviderSetupViewModel.kt b/feature/provider/src/main/java/com/streamvault/feature/provider/setup/ProviderSetupViewModel.kt
index d5d8f51b..d0732cbe 100644
--- a/feature/provider/src/main/java/com/streamvault/feature/provider/setup/ProviderSetupViewModel.kt
+++ b/feature/provider/src/main/java/com/streamvault/feature/provider/setup/ProviderSetupViewModel.kt
@@ -1265,7 +1265,7 @@ data class ProviderSetupState(
val driveSignedIn: Boolean = false,
val driveBackupOptions: List<DriveBackupSnapshot> = emptyList(),
val epgSyncMode: ProviderEpgSyncMode = ProviderEpgSyncMode.BACKGROUND,
- val stalkerCatalogMode: StalkerCatalogMode = StalkerCatalogMode.ON_DEMAND,
+ val stalkerCatalogMode: StalkerCatalogMode = StalkerCatalogMode.BACKGROUND_INDEX,
val xtreamLiveSyncMode: ProviderXtreamLiveSyncMode = ProviderXtreamLiveSyncMode.AUTO,
val guideSourcePolicy: GuideSourcePolicy = GuideSourcePolicy.AUTO,
val channelLogoSourcePolicy: ChannelLogoSourcePolicy = ChannelLogoSourcePolicy.SUPPLIER_PREFERRED,
diff --git a/feature/provider/src/main/res/values-ar/strings.xml b/feature/provider/src/main/res/values-ar/strings.xml
index 9ef3089f..a7beb9e6 100644
--- a/feature/provider/src/main/res/values-ar/strings.xml
+++ b/feature/provider/src/main/res/values-ar/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">الرجوع</string>
<string name="stalker_transport_connect_anyway">الاتصال على أي حال</string>
<string name="stalker_save_without_verification">الحفظ بدون تحقق</string>
+
+ <string name="setup_stalker_catalog_title">كتالوج الأفلام والمسلسلات</string>
+ <string name="setup_stalker_catalog_description">ينفصل عن دليل البرامج. يفهرس الفهرس في الخلفية بعد الإعداد ليتيح البحث.</string>
+ <string name="setup_stalker_catalog_on_demand_title">عند الطلب</string>
+ <string name="setup_stalker_catalog_on_demand_description">حمّل الرفوف والفئات عند فتحها. احتفظ بالعناوين المخزنة مؤقتًا.</string>
+ <string name="setup_stalker_catalog_background_title">فهرسة كاملة في الخلفية (موصى بها)</string>
+ <string name="setup_stalker_catalog_background_description">أكمل إعداد المزوّد أولًا، ثم افهرس جميع عناوين الأفلام والمسلسلات في الخلفية للبحث.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-bg/strings.xml b/feature/provider/src/main/res/values-bg/strings.xml
index b1ea51dc..ebdf7ba7 100644
--- a/feature/provider/src/main/res/values-bg/strings.xml
+++ b/feature/provider/src/main/res/values-bg/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">MAC адрес</string>
<string name="setup_phone_pairing_continue_on_tv">Продължете на телевизора, за да прегледате и завършите тази стъпка.</string>
<string name="setup_phone_pairing_stalker_certificate_error">Сертификатът не можа да бъде проверен безопасно. Прегледайте тази връзка на телевизора.</string>
+
+ <string name="setup_stalker_catalog_title">Каталог с филми и сериали</string>
+ <string name="setup_stalker_catalog_description">Отделно е от програмния справочник. След настройката фоновото индексиране създава каталог за търсене.</string>
+ <string name="setup_stalker_catalog_on_demand_title">При поискване</string>
+ <string name="setup_stalker_catalog_on_demand_description">Зареждайте рафтовете и категориите при отваряне. Запазвайте кешираните заглавия.</string>
+ <string name="setup_stalker_catalog_background_title">Пълно фоново индексиране (препоръчително)</string>
+ <string name="setup_stalker_catalog_background_description">Първо завършете настройката на доставчика, след което индексирайте всички филми и сериали във фонов режим за търсене.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-cs/strings.xml b/feature/provider/src/main/res/values-cs/strings.xml
index b21f2f0c..adb3b2d3 100644
--- a/feature/provider/src/main/res/values-cs/strings.xml
+++ b/feature/provider/src/main/res/values-cs/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Zpět</string>
<string name="stalker_transport_connect_anyway">Přesto se připojit</string>
<string name="stalker_save_without_verification">Uložit bez ověření</string>
+
+ <string name="setup_stalker_catalog_title">Katalog filmů a seriálů</string>
+ <string name="setup_stalker_catalog_description">Je oddělený od televizního programu. Po nastavení vytvoří index na pozadí katalog, ve kterém lze vyhledávat.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Na vyžádání</string>
+ <string name="setup_stalker_catalog_on_demand_description">Police a kategorie načítá při otevření. Uložené tituly ponechá v mezipaměti.</string>
+ <string name="setup_stalker_catalog_background_title">Úplné indexování na pozadí (doporučeno)</string>
+ <string name="setup_stalker_catalog_background_description">Nejprve dokončí nastavení poskytovatele a pak na pozadí zaindexuje všechny filmy a seriály pro vyhledávání.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-da/strings.xml b/feature/provider/src/main/res/values-da/strings.xml
index 2951d788..e31044ee 100644
--- a/feature/provider/src/main/res/values-da/strings.xml
+++ b/feature/provider/src/main/res/values-da/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Gå tilbage</string>
<string name="stalker_transport_connect_anyway">Opret forbindelse alligevel</string>
<string name="stalker_save_without_verification">Gem uden bekræftelse</string>
+
+ <string name="setup_stalker_catalog_title">Film- og seriekatalog</string>
+ <string name="setup_stalker_catalog_description">Dette er adskilt fra programguiden. Baggrundsindeksering opbygger en søgbar katalog efter opsætningen.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Efter behov</string>
+ <string name="setup_stalker_catalog_on_demand_description">Indlæs hylder og kategorier, når de åbnes. Behold titler i cachen.</string>
+ <string name="setup_stalker_catalog_background_title">Komplet baggrundsindeksering (anbefalet)</string>
+ <string name="setup_stalker_catalog_background_description">Færdiggør først udbyderopsætningen, og indekser derefter alle film og serier i baggrunden, så de kan søges frem.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-de/strings.xml b/feature/provider/src/main/res/values-de/strings.xml
index 057bd46e..a2c369e0 100644
--- a/feature/provider/src/main/res/values-de/strings.xml
+++ b/feature/provider/src/main/res/values-de/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Zurück</string>
<string name="stalker_transport_connect_anyway">Trotzdem verbinden</string>
<string name="stalker_save_without_verification">Ohne Überprüfung speichern</string>
+
+ <string name="setup_stalker_catalog_title">Film- und Serienkatalog</string>
+ <string name="setup_stalker_catalog_description">Unabhängig vom EPG. Die Hintergrundindizierung erstellt nach der Einrichtung einen durchsuchbaren Katalog.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Bei Bedarf</string>
+ <string name="setup_stalker_catalog_on_demand_description">Regale und Kategorien werden beim Öffnen geladen. Zwischengespeicherte Titel bleiben erhalten.</string>
+ <string name="setup_stalker_catalog_background_title">Vollständige Hintergrundindizierung (empfohlen)</string>
+ <string name="setup_stalker_catalog_background_description">Schließe zuerst die Anbietereinrichtung ab. Danach werden alle Filme und Serien im Hintergrund für die Suche indiziert.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-el/strings.xml b/feature/provider/src/main/res/values-el/strings.xml
index 7b56a100..68cf0265 100644
--- a/feature/provider/src/main/res/values-el/strings.xml
+++ b/feature/provider/src/main/res/values-el/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Επιστροφή</string>
<string name="stalker_transport_connect_anyway">Σύνδεση ούτως ή άλλως</string>
<string name="stalker_save_without_verification">Αποθήκευση χωρίς επαλήθευση</string>
+
+ <string name="setup_stalker_catalog_title">Κατάλογος ταινιών και σειρών</string>
+ <string name="setup_stalker_catalog_description">Είναι ξεχωριστός από τον οδηγό προγράμματος. Η ευρετηρίαση στο παρασκήνιο δημιουργεί κατάλογο αναζήτησης μετά τη ρύθμιση.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Κατά απαίτηση</string>
+ <string name="setup_stalker_catalog_on_demand_description">Φόρτωση ραφιών και κατηγοριών όταν ανοίγουν. Διατήρηση των αποθηκευμένων τίτλων.</string>
+ <string name="setup_stalker_catalog_background_title">Πλήρης ευρετηρίαση στο παρασκήνιο (συνιστάται)</string>
+ <string name="setup_stalker_catalog_background_description">Ολοκληρώστε πρώτα τη ρύθμιση του παρόχου και έπειτα ευρετηριάστε όλες τις ταινίες και σειρές στο παρασκήνιο για αναζήτηση.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-es/strings.xml b/feature/provider/src/main/res/values-es/strings.xml
index 98025101..e34e14c3 100644
--- a/feature/provider/src/main/res/values-es/strings.xml
+++ b/feature/provider/src/main/res/values-es/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Volver</string>
<string name="stalker_transport_connect_anyway">Conectar de todos modos</string>
<string name="stalker_save_without_verification">Guardar sin verificar</string>
+
+ <string name="setup_stalker_catalog_title">Catálogo de películas y series</string>
+ <string name="setup_stalker_catalog_description">Es independiente de la guía de programación. La indexación en segundo plano crea un catálogo que se puede buscar después de la configuración.</string>
+ <string name="setup_stalker_catalog_on_demand_title">A petición</string>
+ <string name="setup_stalker_catalog_on_demand_description">Carga las secciones y categorías al abrirlas. Conserva los títulos en caché.</string>
+ <string name="setup_stalker_catalog_background_title">Indexación completa en segundo plano (recomendada)</string>
+ <string name="setup_stalker_catalog_background_description">Primero termina de configurar el proveedor y luego indexa todas las películas y series en segundo plano para que puedas buscarlas.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-fa/strings.xml b/feature/provider/src/main/res/values-fa/strings.xml
index 73fbca30..e35de63d 100644
--- a/feature/provider/src/main/res/values-fa/strings.xml
+++ b/feature/provider/src/main/res/values-fa/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">نشانی MAC</string>
<string name="setup_phone_pairing_continue_on_tv">برای بررسی و تکمیل این مرحله، روی تلویزیون ادامه دهید.</string>
<string name="setup_phone_pairing_stalker_certificate_error">گواهی را نمی‌توان با اطمینان بررسی کرد. این اتصال را روی تلویزیون بررسی کنید.</string>
+
+ <string name="setup_stalker_catalog_title">فهرست فیلم و سریال</string>
+ <string name="setup_stalker_catalog_description">این گزینه جدا از راهنمای برنامه است. فهرست‌سازی پس‌زمینه پس از راه‌اندازی، فهرستی قابل جست‌وجو می‌سازد.</string>
+ <string name="setup_stalker_catalog_on_demand_title">هنگام نیاز</string>
+ <string name="setup_stalker_catalog_on_demand_description">قفسه‌ها و دسته‌ها را هنگام باز شدن بارگیری می‌کند. عنوان‌های ذخیره‌شده در حافظه موقت حفظ می‌شوند.</string>
+ <string name="setup_stalker_catalog_background_title">فهرست‌سازی کامل در پس‌زمینه (پیشنهادی)</string>
+ <string name="setup_stalker_catalog_background_description">ابتدا راه‌اندازی ارائه‌دهنده را کامل کنید، سپس همه فیلم‌ها و سریال‌ها را برای جست‌وجو در پس‌زمینه فهرست کنید.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-fi/strings.xml b/feature/provider/src/main/res/values-fi/strings.xml
index 36f525cf..1e578530 100644
--- a/feature/provider/src/main/res/values-fi/strings.xml
+++ b/feature/provider/src/main/res/values-fi/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Takaisin</string>
<string name="stalker_transport_connect_anyway">Yhdistä silti</string>
<string name="stalker_save_without_verification">Tallenna vahvistamatta</string>
+
+ <string name="setup_stalker_catalog_title">Elokuva- ja sarjaluettelo</string>
+ <string name="setup_stalker_catalog_description">Erillään ohjelmaoppaasta. Taustalla tehtävä indeksointi luo haettavan luettelon käyttöönoton jälkeen.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Tarvittaessa</string>
+ <string name="setup_stalker_catalog_on_demand_description">Lataa hyllyt ja kategoriat avattaessa. Säilyttää välimuistissa olevat nimikkeet.</string>
+ <string name="setup_stalker_catalog_background_title">Täysi taustaindeksointi (suositeltu)</string>
+ <string name="setup_stalker_catalog_background_description">Viimeistele ensin palveluntarjoajan käyttöönotto. Sen jälkeen kaikki elokuvat ja sarjat indeksoidaan taustalla hakua varten.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-fil/strings.xml b/feature/provider/src/main/res/values-fil/strings.xml
index a1859a21..6eb396de 100644
--- a/feature/provider/src/main/res/values-fil/strings.xml
+++ b/feature/provider/src/main/res/values-fil/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">Address ng MAC</string>
<string name="setup_phone_pairing_continue_on_tv">Magpatuloy sa TV para suriin at kumpletuhin ang hakbang na ito.</string>
<string name="setup_phone_pairing_stalker_certificate_error">Hindi ligtas na nasuri ang certificate. Suriin ang koneksyong ito sa TV.</string>
+
+ <string name="setup_stalker_catalog_title">Katalogo ng mga pelikula at serye</string>
+ <string name="setup_stalker_catalog_description">Hiwalay ito sa gabay sa programa. Gumagawa ang pag-index sa background ng mahahanap na katalogo pagkatapos ng setup.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Kapag kailangan</string>
+ <string name="setup_stalker_catalog_on_demand_description">Nilo-load ang mga shelf at kategorya kapag binuksan. Pinananatili ang mga naka-cache na pamagat.</string>
+ <string name="setup_stalker_catalog_background_title">Kumpletong pag-index sa background (inirerekomenda)</string>
+ <string name="setup_stalker_catalog_background_description">Tapusin muna ang setup ng provider, saka i-index sa background ang lahat ng pelikula at serye para madaling hanapin.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-fr/strings.xml b/feature/provider/src/main/res/values-fr/strings.xml
index 5f1492e1..de4b8d64 100644
--- a/feature/provider/src/main/res/values-fr/strings.xml
+++ b/feature/provider/src/main/res/values-fr/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Retour</string>
<string name="stalker_transport_connect_anyway">Se connecter quand même</string>
<string name="stalker_save_without_verification">Enregistrer sans vérification</string>
+
+ <string name="setup_stalker_catalog_title">Catalogue de films et de séries</string>
+ <string name="setup_stalker_catalog_description">Séparé du guide des programmes. L’indexation en arrière-plan crée un catalogue consultable après la configuration.</string>
+ <string name="setup_stalker_catalog_on_demand_title">À la demande</string>
+ <string name="setup_stalker_catalog_on_demand_description">Charge les rayons et les catégories à leur ouverture. Conserve les titres en cache.</string>
+ <string name="setup_stalker_catalog_background_title">Indexation complète en arrière-plan (recommandée)</string>
+ <string name="setup_stalker_catalog_background_description">Terminez d’abord la configuration du fournisseur, puis indexez tous les films et séries en arrière-plan pour les rendre consultables.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-hi/strings.xml b/feature/provider/src/main/res/values-hi/strings.xml
index 06ab3a77..97d6d334 100644
--- a/feature/provider/src/main/res/values-hi/strings.xml
+++ b/feature/provider/src/main/res/values-hi/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">MAC पता</string>
<string name="setup_phone_pairing_continue_on_tv">इस चरण की समीक्षा और पूर्ति के लिए टीवी पर आगे बढ़ें।</string>
<string name="setup_phone_pairing_stalker_certificate_error">प्रमाणपत्र की सुरक्षित रूप से जाँच नहीं हो सकी। इस कनेक्शन की समीक्षा टीवी पर करें।</string>
+
+ <string name="setup_stalker_catalog_title">फ़िल्म और सीरीज़ कैटलॉग</string>
+ <string name="setup_stalker_catalog_description">यह कार्यक्रम गाइड से अलग है। सेटअप के बाद बैकग्राउंड इंडेक्सिंग खोजने योग्य कैटलॉग बनाती है।</string>
+ <string name="setup_stalker_catalog_on_demand_title">ज़रूरत पड़ने पर</string>
+ <string name="setup_stalker_catalog_on_demand_description">शेल्फ़ और श्रेणियाँ खोलने पर लोड करें। कैश किए गए शीर्षक रखें।</string>
+ <string name="setup_stalker_catalog_background_title">पूरा बैकग्राउंड इंडेक्स (अनुशंसित)</string>
+ <string name="setup_stalker_catalog_background_description">पहले प्रदाता का सेटअप पूरा करें, फिर खोज के लिए सभी फ़िल्मों और सीरीज़ को बैकग्राउंड में इंडेक्स करें।</string>
</resources>
diff --git a/feature/provider/src/main/res/values-hr/strings.xml b/feature/provider/src/main/res/values-hr/strings.xml
index 797ca846..a04516e5 100644
--- a/feature/provider/src/main/res/values-hr/strings.xml
+++ b/feature/provider/src/main/res/values-hr/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">MAC adresa</string>
<string name="setup_phone_pairing_continue_on_tv">Nastavite na televizoru da biste pregledali i dovršili ovaj korak.</string>
<string name="setup_phone_pairing_stalker_certificate_error">Certifikat nije bilo moguće sigurno provjeriti. Pregledajte ovu vezu na televizoru.</string>
+
+ <string name="setup_stalker_catalog_title">Katalog filmova i serija</string>
+ <string name="setup_stalker_catalog_description">Odvojeno od TV vodiča. Indeksiranje u pozadini nakon postavljanja stvara katalog koji se može pretraživati.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Na zahtjev</string>
+ <string name="setup_stalker_catalog_on_demand_description">Police i kategorije učitavaju se pri otvaranju. Predmemorirani naslovi ostaju spremljeni.</string>
+ <string name="setup_stalker_catalog_background_title">Potpuno indeksiranje u pozadini (preporučeno)</string>
+ <string name="setup_stalker_catalog_background_description">Najprije dovršite postavljanje pružatelja, a zatim u pozadini indeksirajte sve filmove i serije kako biste ih mogli pretraživati.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-hu/strings.xml b/feature/provider/src/main/res/values-hu/strings.xml
index a11078f9..b1e48f12 100644
--- a/feature/provider/src/main/res/values-hu/strings.xml
+++ b/feature/provider/src/main/res/values-hu/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Vissza</string>
<string name="stalker_transport_connect_anyway">Kapcsolódás mindenképpen</string>
<string name="stalker_save_without_verification">Mentés ellenőrzés nélkül</string>
+
+ <string name="setup_stalker_catalog_title">Film- és sorozatkatalógus</string>
+ <string name="setup_stalker_catalog_description">A műsorújságtól külön működik. A háttérben végzett indexelés a beállítás után kereshető katalógust hoz létre.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Igény szerint</string>
+ <string name="setup_stalker_catalog_on_demand_description">A polcok és kategóriák megnyitáskor töltődnek be. A gyorsítótárazott címek megmaradnak.</string>
+ <string name="setup_stalker_catalog_background_title">Teljes háttérindexelés (ajánlott)</string>
+ <string name="setup_stalker_catalog_background_description">Először fejezze be a szolgáltató beállítását, majd indexelje a háttérben az összes filmet és sorozatot a kereséshez.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-in/strings.xml b/feature/provider/src/main/res/values-in/strings.xml
index d492c094..6b7e6514 100644
--- a/feature/provider/src/main/res/values-in/strings.xml
+++ b/feature/provider/src/main/res/values-in/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Kembali</string>
<string name="stalker_transport_connect_anyway">Tetap sambungkan</string>
<string name="stalker_save_without_verification">Simpan tanpa verifikasi</string>
+
+ <string name="setup_stalker_catalog_title">Katalog film dan serial</string>
+ <string name="setup_stalker_catalog_description">Terpisah dari panduan acara. Pengindeksan latar belakang membuat katalog yang dapat dicari setelah penyiapan.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Sesuai permintaan</string>
+ <string name="setup_stalker_catalog_on_demand_description">Muat rak dan kategori saat dibuka. Pertahankan judul yang tersimpan di cache.</string>
+ <string name="setup_stalker_catalog_background_title">Indeks latar belakang lengkap (disarankan)</string>
+ <string name="setup_stalker_catalog_background_description">Selesaikan penyiapan penyedia terlebih dahulu, lalu indeks semua film dan serial di latar belakang agar dapat dicari.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-it/strings.xml b/feature/provider/src/main/res/values-it/strings.xml
index 9f92d4dc..50656653 100644
--- a/feature/provider/src/main/res/values-it/strings.xml
+++ b/feature/provider/src/main/res/values-it/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Torna indietro</string>
<string name="stalker_transport_connect_anyway">Connetti comunque</string>
<string name="stalker_save_without_verification">Salva senza verifica</string>
+
+ <string name="setup_stalker_catalog_title">Catalogo di film e serie</string>
+ <string name="setup_stalker_catalog_description">È separato dalla guida TV. L’indicizzazione in background crea un catalogo ricercabile dopo la configurazione.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Su richiesta</string>
+ <string name="setup_stalker_catalog_on_demand_description">Carica gli scaffali e le categorie quando vengono aperti. Mantiene i titoli nella cache.</string>
+ <string name="setup_stalker_catalog_background_title">Indicizzazione completa in background (consigliata)</string>
+ <string name="setup_stalker_catalog_background_description">Completa prima la configurazione del provider, poi indicizza tutti i film e le serie in background per renderli ricercabili.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-iw/strings.xml b/feature/provider/src/main/res/values-iw/strings.xml
index 43199710..0c409bde 100644
--- a/feature/provider/src/main/res/values-iw/strings.xml
+++ b/feature/provider/src/main/res/values-iw/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">חזרה</string>
<string name="stalker_transport_connect_anyway">התחבר בכל זאת</string>
<string name="stalker_save_without_verification">שמירה ללא אימות</string>
+
+ <string name="setup_stalker_catalog_title">קטלוג סרטים וסדרות</string>
+ <string name="setup_stalker_catalog_description">נפרד ממדריך התוכניות. יצירת אינדקס ברקע בונה קטלוג שניתן לחפש בו לאחר ההגדרה.</string>
+ <string name="setup_stalker_catalog_on_demand_title">לפי דרישה</string>
+ <string name="setup_stalker_catalog_on_demand_description">טעינת המדפים והקטגוריות בעת פתיחתם. שמירת הכותרים שבמטמון.</string>
+ <string name="setup_stalker_catalog_background_title">יצירת אינדקס מלאה ברקע (מומלץ)</string>
+ <string name="setup_stalker_catalog_background_description">יש להשלים תחילה את הגדרת הספק, ולאחר מכן ליצור ברקע אינדקס לכל הסרטים והסדרות כדי שאפשר יהיה לחפש בהם.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-ja/strings.xml b/feature/provider/src/main/res/values-ja/strings.xml
index 2c33edb7..6ae7ffea 100644
--- a/feature/provider/src/main/res/values-ja/strings.xml
+++ b/feature/provider/src/main/res/values-ja/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">戻る</string>
<string name="stalker_transport_connect_anyway">接続する</string>
<string name="stalker_save_without_verification">確認せずに保存</string>
+
+ <string name="setup_stalker_catalog_title">映画・シリーズのカタログ</string>
+ <string name="setup_stalker_catalog_description">番組表とは別の機能です。セットアップ後にバックグラウンドでインデックスを作成し、検索できるカタログを用意します。</string>
+ <string name="setup_stalker_catalog_on_demand_title">必要なときに読み込む</string>
+ <string name="setup_stalker_catalog_on_demand_description">棚とカテゴリは開いたときに読み込みます。キャッシュ済みのタイトルは保持します。</string>
+ <string name="setup_stalker_catalog_background_title">バックグラウンドで全件インデックス(おすすめ)</string>
+ <string name="setup_stalker_catalog_background_description">先にプロバイダーのセットアップを完了し、その後、検索できるようにすべての映画とシリーズをバックグラウンドでインデックスします。</string>
</resources>
diff --git a/feature/provider/src/main/res/values-ko/strings.xml b/feature/provider/src/main/res/values-ko/strings.xml
index a57a4033..5fb009cb 100644
--- a/feature/provider/src/main/res/values-ko/strings.xml
+++ b/feature/provider/src/main/res/values-ko/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">뒤로</string>
<string name="stalker_transport_connect_anyway">그래도 연결</string>
<string name="stalker_save_without_verification">확인 없이 저장</string>
+
+ <string name="setup_stalker_catalog_title">영화 및 시리즈 카탈로그</string>
+ <string name="setup_stalker_catalog_description">프로그램 안내와 별도로 작동합니다. 설정 후 백그라운드 색인을 통해 검색 가능한 카탈로그를 만듭니다.</string>
+ <string name="setup_stalker_catalog_on_demand_title">필요할 때 로드</string>
+ <string name="setup_stalker_catalog_on_demand_description">선반과 카테고리를 열 때 로드합니다. 캐시된 제목은 유지합니다.</string>
+ <string name="setup_stalker_catalog_background_title">백그라운드 전체 색인 (권장)</string>
+ <string name="setup_stalker_catalog_background_description">먼저 제공업체 설정을 완료한 다음 검색할 수 있도록 모든 영화와 시리즈를 백그라운드에서 색인합니다.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-mk/strings.xml b/feature/provider/src/main/res/values-mk/strings.xml
index bc36b148..49a5575a 100644
--- a/feature/provider/src/main/res/values-mk/strings.xml
+++ b/feature/provider/src/main/res/values-mk/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">MAC-адреса</string>
<string name="setup_phone_pairing_continue_on_tv">Продолжете на телевизорот за да го прегледате и довршите овој чекор.</string>
<string name="setup_phone_pairing_stalker_certificate_error">Сертификатот не можеше безбедно да се провери. Проверете ја оваа врска на телевизорот.</string>
+
+ <string name="setup_stalker_catalog_title">Каталог на филмови и серии</string>
+ <string name="setup_stalker_catalog_description">Одделен е од ТВ-водичот. Индексирањето во заднина создава каталог за пребарување по поставувањето.</string>
+ <string name="setup_stalker_catalog_on_demand_title">По потреба</string>
+ <string name="setup_stalker_catalog_on_demand_description">Полиците и категориите се вчитуваат кога ќе се отворат. Кешираните наслови се задржуваат.</string>
+ <string name="setup_stalker_catalog_background_title">Целосно индексирање во заднина (препорачано)</string>
+ <string name="setup_stalker_catalog_background_description">Прво завршете го поставувањето на провајдерот, а потоа индексирајте ги сите филмови и серии во заднина за пребарување.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-ms/strings.xml b/feature/provider/src/main/res/values-ms/strings.xml
index f61891b2..fbba1349 100644
--- a/feature/provider/src/main/res/values-ms/strings.xml
+++ b/feature/provider/src/main/res/values-ms/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">Alamat MAC</string>
<string name="setup_phone_pairing_continue_on_tv">Teruskan pada TV untuk menyemak dan melengkapkan langkah ini.</string>
<string name="setup_phone_pairing_stalker_certificate_error">Sijil tidak dapat diperiksa dengan selamat. Semak sambungan ini pada TV.</string>
+
+ <string name="setup_stalker_catalog_title">Katalog filem dan siri</string>
+ <string name="setup_stalker_catalog_description">Berasingan daripada panduan program. Pengindeksan latar belakang membina katalog yang boleh dicari selepas persediaan.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Atas permintaan</string>
+ <string name="setup_stalker_catalog_on_demand_description">Muatkan rak dan kategori apabila dibuka. Kekalkan tajuk yang dicache.</string>
+ <string name="setup_stalker_catalog_background_title">Indeks latar belakang lengkap (disyorkan)</string>
+ <string name="setup_stalker_catalog_background_description">Selesaikan persediaan penyedia dahulu, kemudian indeks semua filem dan siri di latar belakang untuk carian.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-nb/strings.xml b/feature/provider/src/main/res/values-nb/strings.xml
index 5ff91ee3..0b59790b 100644
--- a/feature/provider/src/main/res/values-nb/strings.xml
+++ b/feature/provider/src/main/res/values-nb/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Gå tilbake</string>
<string name="stalker_transport_connect_anyway">Koble til likevel</string>
<string name="stalker_save_without_verification">Lagre uten bekreftelse</string>
+
+ <string name="setup_stalker_catalog_title">Film- og seriekatalog</string>
+ <string name="setup_stalker_catalog_description">Uavhengig av programguiden. Bakgrunnsindeksering lager en søkbar katalog etter oppsettet.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Ved behov</string>
+ <string name="setup_stalker_catalog_on_demand_description">Hyller og kategorier lastes inn når de åpnes. Bufrede titler beholdes.</string>
+ <string name="setup_stalker_catalog_background_title">Full bakgrunnsindeksering (anbefalt)</string>
+ <string name="setup_stalker_catalog_background_description">Fullfør først oppsettet av leverandøren, og indekser deretter alle filmer og serier i bakgrunnen slik at de kan søkes opp.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-nl/strings.xml b/feature/provider/src/main/res/values-nl/strings.xml
index fc272779..52d6dcf1 100644
--- a/feature/provider/src/main/res/values-nl/strings.xml
+++ b/feature/provider/src/main/res/values-nl/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Terug</string>
<string name="stalker_transport_connect_anyway">Toch verbinden</string>
<string name="stalker_save_without_verification">Opslaan zonder verificatie</string>
+
+ <string name="setup_stalker_catalog_title">Film- en seriecatalogus</string>
+ <string name="setup_stalker_catalog_description">Staat los van de programgids. Indexeren op de achtergrond maakt na de installatie een doorzoekbare catalogus.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Op aanvraag</string>
+ <string name="setup_stalker_catalog_on_demand_description">Laad planken en categorieën wanneer ze worden geopend. Bewaar titels in de cache.</string>
+ <string name="setup_stalker_catalog_background_title">Volledige achtergrondindex (aanbevolen)</string>
+ <string name="setup_stalker_catalog_background_description">Rond eerst de installatie van de provider af en indexeer daarna alle films en series op de achtergrond, zodat je ze kunt zoeken.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-pl/strings.xml b/feature/provider/src/main/res/values-pl/strings.xml
index 9782d4db..ea3a3c60 100644
--- a/feature/provider/src/main/res/values-pl/strings.xml
+++ b/feature/provider/src/main/res/values-pl/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Wróć</string>
<string name="stalker_transport_connect_anyway">Połącz mimo to</string>
<string name="stalker_save_without_verification">Zapisz bez weryfikacji</string>
+
+ <string name="setup_stalker_catalog_title">Katalog filmów i seriali</string>
+ <string name="setup_stalker_catalog_description">Działa niezależnie od przewodnika TV. Indeksowanie w tle tworzy przeszukiwalny katalog po konfiguracji.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Na żądanie</string>
+ <string name="setup_stalker_catalog_on_demand_description">Półki i kategorie są wczytywane po otwarciu. Tytuły w pamięci podręcznej są zachowywane.</string>
+ <string name="setup_stalker_catalog_background_title">Pełne indeksowanie w tle (zalecane)</string>
+ <string name="setup_stalker_catalog_background_description">Najpierw zakończ konfigurację dostawcy, a następnie indeksuj w tle wszystkie filmy i seriale, aby można je było wyszukiwać.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-pt/strings.xml b/feature/provider/src/main/res/values-pt/strings.xml
index abc05ba3..e95b5eb4 100644
--- a/feature/provider/src/main/res/values-pt/strings.xml
+++ b/feature/provider/src/main/res/values-pt/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Voltar</string>
<string name="stalker_transport_connect_anyway">Conectar mesmo assim</string>
<string name="stalker_save_without_verification">Salvar sem verificar</string>
+
+ <string name="setup_stalker_catalog_title">Catálogo de filmes e séries</string>
+ <string name="setup_stalker_catalog_description">É independente do guia de programação. A indexação em segundo plano cria um catálogo pesquisável após a configuração.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Sob demanda</string>
+ <string name="setup_stalker_catalog_on_demand_description">Carrega prateleiras e categorias quando são abertas. Mantém os títulos em cache.</string>
+ <string name="setup_stalker_catalog_background_title">Indexação completa em segundo plano (recomendada)</string>
+ <string name="setup_stalker_catalog_background_description">Conclua primeiro a configuração do fornecedor e depois indexe todos os filmes e séries em segundo plano para poder pesquisá-los.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-ro/strings.xml b/feature/provider/src/main/res/values-ro/strings.xml
index ea2c5fed..41497fbd 100644
--- a/feature/provider/src/main/res/values-ro/strings.xml
+++ b/feature/provider/src/main/res/values-ro/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Înapoi</string>
<string name="stalker_transport_connect_anyway">Conectează oricum</string>
<string name="stalker_save_without_verification">Salvează fără verificare</string>
+
+ <string name="setup_stalker_catalog_title">Catalog de filme și seriale</string>
+ <string name="setup_stalker_catalog_description">Este separat de ghidul TV. Indexarea în fundal creează un catalog în care poți căuta după configurare.</string>
+ <string name="setup_stalker_catalog_on_demand_title">La cerere</string>
+ <string name="setup_stalker_catalog_on_demand_description">Încarcă rafturile și categoriile când sunt deschise. Păstrează titlurile din memoria cache.</string>
+ <string name="setup_stalker_catalog_background_title">Indexare completă în fundal (recomandată)</string>
+ <string name="setup_stalker_catalog_background_description">Finalizează mai întâi configurarea furnizorului, apoi indexează în fundal toate filmele și serialele pentru a le putea căuta.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-ru/strings.xml b/feature/provider/src/main/res/values-ru/strings.xml
index 911a19f6..723d4547 100644
--- a/feature/provider/src/main/res/values-ru/strings.xml
+++ b/feature/provider/src/main/res/values-ru/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Назад</string>
<string name="stalker_transport_connect_anyway">Всё равно подключиться</string>
<string name="stalker_save_without_verification">Сохранить без проверки</string>
+
+ <string name="setup_stalker_catalog_title">Каталог фильмов и сериалов</string>
+ <string name="setup_stalker_catalog_description">Работает отдельно от телепрограммы. После настройки фоновая индексация создаст каталог для поиска.</string>
+ <string name="setup_stalker_catalog_on_demand_title">По запросу</string>
+ <string name="setup_stalker_catalog_on_demand_description">Полки и категории загружаются при открытии. Загруженные в кэш названия сохраняются.</string>
+ <string name="setup_stalker_catalog_background_title">Полная фоновая индексация (рекомендуется)</string>
+ <string name="setup_stalker_catalog_background_description">Сначала завершите настройку провайдера, затем проиндексируйте все фильмы и сериалы в фоне, чтобы их можно было найти через поиск.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-sk/strings.xml b/feature/provider/src/main/res/values-sk/strings.xml
index 9e10236e..dde10e14 100644
--- a/feature/provider/src/main/res/values-sk/strings.xml
+++ b/feature/provider/src/main/res/values-sk/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">MAC adresa</string>
<string name="setup_phone_pairing_continue_on_tv">Pokračujte na televízore a skontrolujte a dokončite tento krok.</string>
<string name="setup_phone_pairing_stalker_certificate_error">Certifikát sa nepodarilo bezpečne skontrolovať. Skontrolujte toto pripojenie na televízore.</string>
+
+ <string name="setup_stalker_catalog_title">Katalóg filmov a seriálov</string>
+ <string name="setup_stalker_catalog_description">Je oddelený od TV programu. Indexovanie na pozadí po nastavení vytvorí prehľadávateľný katalóg.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Na požiadanie</string>
+ <string name="setup_stalker_catalog_on_demand_description">Police a kategórie sa načítajú po otvorení. Tituly vo vyrovnávacej pamäti zostanú zachované.</string>
+ <string name="setup_stalker_catalog_background_title">Úplné indexovanie na pozadí (odporúčané)</string>
+ <string name="setup_stalker_catalog_background_description">Najprv dokončite nastavenie poskytovateľa a potom na pozadí zaindexujte všetky filmy a seriály, aby sa dali vyhľadávať.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-sq/strings.xml b/feature/provider/src/main/res/values-sq/strings.xml
index 87fdb1c1..dc9cbd47 100644
--- a/feature/provider/src/main/res/values-sq/strings.xml
+++ b/feature/provider/src/main/res/values-sq/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">Adresa MAC</string>
<string name="setup_phone_pairing_continue_on_tv">Vazhdo në televizor për ta shqyrtuar dhe përfunduar këtë hap.</string>
<string name="setup_phone_pairing_stalker_certificate_error">Certifikata nuk mund të kontrollohej në mënyrë të sigurt. Shqyrtoje këtë lidhje në televizor.</string>
+
+ <string name="setup_stalker_catalog_title">Katalogu i filmave dhe serialeve</string>
+ <string name="setup_stalker_catalog_description">Është i ndarë nga guida e programeve. Indeksimi në sfond krijon katalog të kërkueshëm pas konfigurimit.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Sipas kërkesës</string>
+ <string name="setup_stalker_catalog_on_demand_description">Raftet dhe kategoritë ngarkohen kur hapen. Titujt e ruajtur në memorien e përkohshme mbahen.</string>
+ <string name="setup_stalker_catalog_background_title">Indeksim i plotë në sfond (i rekomanduar)</string>
+ <string name="setup_stalker_catalog_background_description">Përfundoni fillimisht konfigurimin e ofruesit, pastaj indeksoni në sfond të gjithë filmat dhe serialet për t’i kërkuar.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-sr/strings.xml b/feature/provider/src/main/res/values-sr/strings.xml
index 97af60ba..916651b9 100644
--- a/feature/provider/src/main/res/values-sr/strings.xml
+++ b/feature/provider/src/main/res/values-sr/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">MAC адреса</string>
<string name="setup_phone_pairing_continue_on_tv">Наставите на телевизору да бисте прегледали и довршили овај корак.</string>
<string name="setup_phone_pairing_stalker_certificate_error">Сертификат није могао безбедно да се провери. Прегледајте ову везу на телевизору.</string>
+
+ <string name="setup_stalker_catalog_title">Каталог филмова и серија</string>
+ <string name="setup_stalker_catalog_description">Одвојен је од ТВ водича. Индексирање у позадини после подешавања прави каталог који може да се претражује.</string>
+ <string name="setup_stalker_catalog_on_demand_title">На захтев</string>
+ <string name="setup_stalker_catalog_on_demand_description">Полице и категорије се учитавају када их отворите. Кеширани наслови се чувају.</string>
+ <string name="setup_stalker_catalog_background_title">Потпуно индексирање у позадини (препоручено)</string>
+ <string name="setup_stalker_catalog_background_description">Прво довршите подешавање провајдера, а затим у позадини индексирајте све филмове и серије да бисте могли да их претражујете.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-sv/strings.xml b/feature/provider/src/main/res/values-sv/strings.xml
index 05a7a5dc..449a49db 100644
--- a/feature/provider/src/main/res/values-sv/strings.xml
+++ b/feature/provider/src/main/res/values-sv/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Gå tillbaka</string>
<string name="stalker_transport_connect_anyway">Anslut ändå</string>
<string name="stalker_save_without_verification">Spara utan verifiering</string>
+
+ <string name="setup_stalker_catalog_title">Film- och seriekatalog</string>
+ <string name="setup_stalker_catalog_description">Separat från programguiden. Bakgrundsindexering skapar en sökbar katalog efter konfigurationen.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Vid behov</string>
+ <string name="setup_stalker_catalog_on_demand_description">Läs in hyllor och kategorier när de öppnas. Behåll titlar i cacheminnet.</string>
+ <string name="setup_stalker_catalog_background_title">Fullständig bakgrundsindexering (rekommenderas)</string>
+ <string name="setup_stalker_catalog_background_description">Slutför först konfigurationen av leverantören och indexera sedan alla filmer och serier i bakgrunden så att de går att söka efter.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-th/strings.xml b/feature/provider/src/main/res/values-th/strings.xml
index 632278cd..83b8101c 100644
--- a/feature/provider/src/main/res/values-th/strings.xml
+++ b/feature/provider/src/main/res/values-th/strings.xml
@@ -122,4 +122,11 @@
<string name="setup_phone_pairing_mac_label">ที่อยู่ MAC</string>
<string name="setup_phone_pairing_continue_on_tv">ดำเนินการต่อบนทีวีเพื่อตรวจสอบและทำขั้นตอนนี้ให้เสร็จ</string>
<string name="setup_phone_pairing_stalker_certificate_error">ตรวจสอบใบรับรองอย่างปลอดภัยไม่ได้ โปรดตรวจสอบการเชื่อมต่อนี้บนทีวี</string>
+
+ <string name="setup_stalker_catalog_title">แค็ตตาล็อกภาพยนตร์และซีรีส์</string>
+ <string name="setup_stalker_catalog_description">แยกจากคู่มือรายการทีวี การจัดทำดัชนีเบื้องหลังจะสร้างแค็ตตาล็อกที่ค้นหาได้หลังตั้งค่าเสร็จ</string>
+ <string name="setup_stalker_catalog_on_demand_title">โหลดเมื่อต้องการ</string>
+ <string name="setup_stalker_catalog_on_demand_description">โหลดชั้นวางและหมวดหมู่เมื่อเปิด เก็บชื่อเรื่องที่อยู่ในแคชไว้</string>
+ <string name="setup_stalker_catalog_background_title">จัดทำดัชนีเบื้องหลังทั้งหมด (แนะนำ)</string>
+ <string name="setup_stalker_catalog_background_description">ตั้งค่าผู้ให้บริการให้เสร็จก่อน จากนั้นจัดทำดัชนีภาพยนตร์และซีรีส์ทั้งหมดเบื้องหลังเพื่อให้ค้นหาได้</string>
</resources>
diff --git a/feature/provider/src/main/res/values-tr/strings.xml b/feature/provider/src/main/res/values-tr/strings.xml
index 896364e1..f96e415e 100644
--- a/feature/provider/src/main/res/values-tr/strings.xml
+++ b/feature/provider/src/main/res/values-tr/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Geri dön</string>
<string name="stalker_transport_connect_anyway">Yine de bağlan</string>
<string name="stalker_save_without_verification">Doğrulamadan kaydet</string>
+
+ <string name="setup_stalker_catalog_title">Film ve dizi kataloğu</string>
+ <string name="setup_stalker_catalog_description">Program rehberinden ayrıdır. Arka plan dizin oluşturma, kurulumdan sonra aranabilir bir katalog hazırlar.</string>
+ <string name="setup_stalker_catalog_on_demand_title">İsteğe bağlı</string>
+ <string name="setup_stalker_catalog_on_demand_description">Rafları ve kategorileri açıldıklarında yükler. Önbelleğe alınan başlıkları korur.</string>
+ <string name="setup_stalker_catalog_background_title">Tam arka plan dizini (önerilen)</string>
+ <string name="setup_stalker_catalog_background_description">Önce sağlayıcı kurulumunu tamamlayın, ardından aranabilmeleri için tüm filmleri ve dizileri arka planda dizine ekleyin.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-uk/strings.xml b/feature/provider/src/main/res/values-uk/strings.xml
index 478e5b57..cab734ac 100644
--- a/feature/provider/src/main/res/values-uk/strings.xml
+++ b/feature/provider/src/main/res/values-uk/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Назад</string>
<string name="stalker_transport_connect_anyway">Усе одно під’єднатися</string>
<string name="stalker_save_without_verification">Зберегти без перевірки</string>
+
+ <string name="setup_stalker_catalog_title">Каталог фільмів і серіалів</string>
+ <string name="setup_stalker_catalog_description">Окремо від телепрограми. Фонова індексація після налаштування створює каталог для пошуку.</string>
+ <string name="setup_stalker_catalog_on_demand_title">На вимогу</string>
+ <string name="setup_stalker_catalog_on_demand_description">Полиці й категорії завантажуються під час відкриття. Кешовані назви зберігаються.</string>
+ <string name="setup_stalker_catalog_background_title">Повна фонова індексація (рекомендовано)</string>
+ <string name="setup_stalker_catalog_background_description">Спочатку завершіть налаштування провайдера, а потім проіндексуйте у фоновому режимі всі фільми й серіали для пошуку.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-vi/strings.xml b/feature/provider/src/main/res/values-vi/strings.xml
index 1a8124cc..f23c7720 100644
--- a/feature/provider/src/main/res/values-vi/strings.xml
+++ b/feature/provider/src/main/res/values-vi/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">Quay lại</string>
<string name="stalker_transport_connect_anyway">Vẫn kết nối</string>
<string name="stalker_save_without_verification">Lưu mà không xác minh</string>
+
+ <string name="setup_stalker_catalog_title">Danh mục phim và bộ phim</string>
+ <string name="setup_stalker_catalog_description">Tách biệt với hướng dẫn chương trình. Việc lập chỉ mục nền tạo danh mục có thể tìm kiếm sau khi thiết lập.</string>
+ <string name="setup_stalker_catalog_on_demand_title">Theo yêu cầu</string>
+ <string name="setup_stalker_catalog_on_demand_description">Tải kệ và danh mục khi mở. Giữ lại các tựa đã lưu trong bộ nhớ đệm.</string>
+ <string name="setup_stalker_catalog_background_title">Lập chỉ mục nền đầy đủ (đề xuất)</string>
+ <string name="setup_stalker_catalog_background_description">Hoàn tất thiết lập nhà cung cấp trước, sau đó lập chỉ mục tất cả phim và bộ phim trong nền để có thể tìm kiếm.</string>
</resources>
diff --git a/feature/provider/src/main/res/values-zh-rTW/strings.xml b/feature/provider/src/main/res/values-zh-rTW/strings.xml
index e5f35de2..f9de7b55 100644
--- a/feature/provider/src/main/res/values-zh-rTW/strings.xml
+++ b/feature/provider/src/main/res/values-zh-rTW/strings.xml
@@ -122,4 +122,10 @@
<string name="setup_phone_pairing_mac_label">MAC 位址</string>
<string name="setup_phone_pairing_continue_on_tv">請在電視上繼續,以檢查並完成此步驟。</string>
<string name="setup_phone_pairing_stalker_certificate_error">無法安全地檢查憑證。請在電視上檢查此連線。</string>
+ <string name="setup_stalker_catalog_title">電影與影集目錄</string>
+ <string name="setup_stalker_catalog_description">與節目表分開。設定完成後,背景索引會建立可搜尋的目錄。</string>
+ <string name="setup_stalker_catalog_on_demand_title">視需要載入</string>
+ <string name="setup_stalker_catalog_on_demand_description">開啟時載入各區和類別。保留已快取的片名。</string>
+ <string name="setup_stalker_catalog_background_title">完整背景索引(建議)</string>
+ <string name="setup_stalker_catalog_background_description">先完成供應商設定,再於背景為所有電影與影集建立索引,方便搜尋。</string>
</resources>
diff --git a/feature/provider/src/main/res/values-zh/strings.xml b/feature/provider/src/main/res/values-zh/strings.xml
index 893738ae..cf197410 100644
--- a/feature/provider/src/main/res/values-zh/strings.xml
+++ b/feature/provider/src/main/res/values-zh/strings.xml
@@ -118,4 +118,11 @@
<string name="stalker_transport_go_back">返回</string>
<string name="stalker_transport_connect_anyway">仍然连接</string>
<string name="stalker_save_without_verification">未经验证保存</string>
+
+ <string name="setup_stalker_catalog_title">电影和剧集目录</string>
+ <string name="setup_stalker_catalog_description">与节目指南分开。设置完成后,后台索引会建立可搜索的目录。</string>
+ <string name="setup_stalker_catalog_on_demand_title">按需加载</string>
+ <string name="setup_stalker_catalog_on_demand_description">打开时加载各栏和类别。保留已缓存的标题。</string>
+ <string name="setup_stalker_catalog_background_title">完整后台索引(推荐)</string>
+ <string name="setup_stalker_catalog_background_description">先完成服务商设置,然后在后台为所有电影和剧集建立索引,以便搜索。</string>
</resources>
diff --git a/feature/provider/src/main/res/values/strings.xml b/feature/provider/src/main/res/values/strings.xml
index 5c276a15..71622004 100644
--- a/feature/provider/src/main/res/values/strings.xml
+++ b/feature/provider/src/main/res/values/strings.xml
@@ -122,4 +122,10 @@
<string name="setup_phone_pairing_mac_label">MAC address</string>
<string name="setup_phone_pairing_continue_on_tv">Continue on the TV to review and complete this step.</string>
<string name="setup_phone_pairing_stalker_certificate_error">The certificate could not be checked safely. Review this connection on the TV.</string>
+ <string name="setup_stalker_catalog_title">Movie and series catalog</string>
+ <string name="setup_stalker_catalog_description">Separate from the TV guide. Background indexing builds a searchable catalog after setup.</string>
+ <string name="setup_stalker_catalog_on_demand_title">On demand</string>
+ <string name="setup_stalker_catalog_on_demand_description">Load shelves and categories when opened. Keep cached titles.</string>
+ <string name="setup_stalker_catalog_background_title">Complete background index (recommended)</string>
+ <string name="setup_stalker_catalog_background_description">Finish provider setup first, then index all movie and series titles in the background so you can search them.</string>
</resources>