reformat code
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M400,720L400,640L560,640L560,720L400,720ZM240,520L240,440L720,440L720,520L240,520ZM120,320L120,240L840,240L840,320L120,320Z"/>
|
||||
android:viewportHeight="960">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M400,720L400,640L560,640L560,720L400,720ZM240,520L240,440L720,440L720,520L240,520ZM120,320L120,240L840,240L840,320L120,320Z" />
|
||||
</vector>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M680,880Q630,880 595,845Q560,810 560,760Q560,754 563,732L282,568Q266,583 245,591.5Q224,600 200,600Q150,600 115,565Q80,530 80,480Q80,430 115,395Q150,360 200,360Q224,360 245,368.5Q266,377 282,392L563,228Q561,221 560.5,214.5Q560,208 560,200Q560,150 595,115Q630,80 680,80Q730,80 765,115Q800,150 800,200Q800,250 765,285Q730,320 680,320Q656,320 635,311.5Q614,303 598,288L317,452Q319,459 319.5,465.5Q320,472 320,480Q320,488 319.5,494.5Q319,501 317,508L598,672Q614,657 635,648.5Q656,640 680,640Q730,640 765,675Q800,710 800,760Q800,810 765,845Q730,880 680,880ZM680,800Q697,800 708.5,788.5Q720,777 720,760Q720,743 708.5,731.5Q697,720 680,720Q663,720 651.5,731.5Q640,743 640,760Q640,777 651.5,788.5Q663,800 680,800ZM200,520Q217,520 228.5,508.5Q240,497 240,480Q240,463 228.5,451.5Q217,440 200,440Q183,440 171.5,451.5Q160,463 160,480Q160,497 171.5,508.5Q183,520 200,520ZM708.5,228.5Q720,217 720,200Q720,183 708.5,171.5Q697,160 680,160Q663,160 651.5,171.5Q640,183 640,200Q640,217 651.5,228.5Q663,240 680,240Q697,240 708.5,228.5ZM680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760ZM200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480ZM680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Z"/>
|
||||
android:viewportHeight="960">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M680,880Q630,880 595,845Q560,810 560,760Q560,754 563,732L282,568Q266,583 245,591.5Q224,600 200,600Q150,600 115,565Q80,530 80,480Q80,430 115,395Q150,360 200,360Q224,360 245,368.5Q266,377 282,392L563,228Q561,221 560.5,214.5Q560,208 560,200Q560,150 595,115Q630,80 680,80Q730,80 765,115Q800,150 800,200Q800,250 765,285Q730,320 680,320Q656,320 635,311.5Q614,303 598,288L317,452Q319,459 319.5,465.5Q320,472 320,480Q320,488 319.5,494.5Q319,501 317,508L598,672Q614,657 635,648.5Q656,640 680,640Q730,640 765,675Q800,710 800,760Q800,810 765,845Q730,880 680,880ZM680,800Q697,800 708.5,788.5Q720,777 720,760Q720,743 708.5,731.5Q697,720 680,720Q663,720 651.5,731.5Q640,743 640,760Q640,777 651.5,788.5Q663,800 680,800ZM200,520Q217,520 228.5,508.5Q240,497 240,480Q240,463 228.5,451.5Q217,440 200,440Q183,440 171.5,451.5Q160,463 160,480Q160,497 171.5,508.5Q183,520 200,520ZM708.5,228.5Q720,217 720,200Q720,183 708.5,171.5Q697,160 680,160Q663,160 651.5,171.5Q640,183 640,200Q640,217 651.5,228.5Q663,240 680,240Q697,240 708.5,228.5ZM680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760Q680,760 680,760ZM200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480Q200,480 200,480ZM680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Q680,200 680,200Z" />
|
||||
</vector>
|
||||
|
||||
+7
-6
@@ -62,10 +62,11 @@ class FallbackVideoApi(
|
||||
return json.decodeFromString(value)
|
||||
}
|
||||
|
||||
private suspend inline fun <reified T> writeByKey(key: String, value: T) = withContext(dispatcherProvider.io) {
|
||||
getCache().insert(
|
||||
key,
|
||||
json.encodeToString(value)
|
||||
)
|
||||
}
|
||||
private suspend inline fun <reified T> writeByKey(key: String, value: T) =
|
||||
withContext(dispatcherProvider.io) {
|
||||
getCache().insert(
|
||||
key,
|
||||
json.encodeToString(value)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+16
-14
@@ -24,21 +24,23 @@ class SqlRecentlyWatchedRepository(
|
||||
private val dispatcherProvider: DispatcherProvider
|
||||
) : RecentlyWatchedRepository {
|
||||
|
||||
override suspend fun write(info: RecentlyWatchedInfo): Unit = withContext(dispatcherProvider.io) {
|
||||
dbProvider.get().recentlyWatchedQueries.insertRecentlyWatched(
|
||||
info.movieId,
|
||||
info.episode ?: UNKNOWN,
|
||||
info.season ?: UNKNOWN
|
||||
)
|
||||
}
|
||||
override suspend fun write(info: RecentlyWatchedInfo): Unit =
|
||||
withContext(dispatcherProvider.io) {
|
||||
dbProvider.get().recentlyWatchedQueries.insertRecentlyWatched(
|
||||
info.movieId,
|
||||
info.episode ?: UNKNOWN,
|
||||
info.season ?: UNKNOWN
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun remove(info: RecentlyWatchedInfo): Unit = withContext(dispatcherProvider.io) {
|
||||
dbProvider.get().recentlyWatchedQueries.deleteRwByIds(
|
||||
info.movieId,
|
||||
info.episode ?: UNKNOWN,
|
||||
info.season ?: UNKNOWN
|
||||
)
|
||||
}
|
||||
override suspend fun remove(info: RecentlyWatchedInfo): Unit =
|
||||
withContext(dispatcherProvider.io) {
|
||||
dbProvider.get().recentlyWatchedQueries.deleteRwByIds(
|
||||
info.movieId,
|
||||
info.episode ?: UNKNOWN,
|
||||
info.season ?: UNKNOWN
|
||||
)
|
||||
}
|
||||
|
||||
override fun queryRecentlyWatched(
|
||||
movieId: Long,
|
||||
|
||||
+4
-1
@@ -31,7 +31,10 @@ class SyncClientServerRecentlyWatchedRepository(
|
||||
private val pendingOperationSynchronizer: PendingOperationSynchronizer
|
||||
) : RecentlyWatchedRepository {
|
||||
|
||||
override fun queryRecentlyWatched(movieId: Long, seasonId: Long?): Flow<List<RecentlyWatchedInfo>> {
|
||||
override fun queryRecentlyWatched(
|
||||
movieId: Long,
|
||||
seasonId: Long?
|
||||
): Flow<List<RecentlyWatchedInfo>> {
|
||||
return authTokenCache.queryFlow(
|
||||
remote.queryRecentlyWatched(movieId, seasonId),
|
||||
local.queryRecentlyWatched(movieId, seasonId)
|
||||
|
||||
+4
-3
@@ -49,9 +49,10 @@ class SqlSearchRepository(
|
||||
getQueries().deleteAll()
|
||||
}
|
||||
|
||||
override suspend fun deleteFromSearch(query: String): Unit = withContext(dispatcherProvider.io) {
|
||||
getQueries().deleteSearchInfo(query)
|
||||
}
|
||||
override suspend fun deleteFromSearch(query: String): Unit =
|
||||
withContext(dispatcherProvider.io) {
|
||||
getQueries().deleteSearchInfo(query)
|
||||
}
|
||||
|
||||
override suspend fun addToSearch(query: String) = withContext(dispatcherProvider.io) {
|
||||
if (getQueries().selectByQuery(query).awaitAsOneOrNull() == null) {
|
||||
|
||||
+21
-19
@@ -28,27 +28,29 @@ class SqlPendingOperationRepository(
|
||||
getQueries().deleteOperation(id)
|
||||
}
|
||||
|
||||
override suspend fun query(type: AggregateType): List<OperationInfo> = withContext(dispatcherProvider.io) {
|
||||
val records = getQueries().getOperationsByAggregate(type.name).awaitAsList()
|
||||
records.map { record ->
|
||||
OperationInfo(
|
||||
id = record.id,
|
||||
type = type,
|
||||
actionType = record.actionType,
|
||||
payload = record.payload?.let { json.parseToJsonElement(it) } ?: JsonNull
|
||||
override suspend fun query(type: AggregateType): List<OperationInfo> =
|
||||
withContext(dispatcherProvider.io) {
|
||||
val records = getQueries().getOperationsByAggregate(type.name).awaitAsList()
|
||||
records.map { record ->
|
||||
OperationInfo(
|
||||
id = record.id,
|
||||
type = type,
|
||||
actionType = record.actionType,
|
||||
payload = record.payload?.let { json.parseToJsonElement(it) } ?: JsonNull
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun insert(operationInfo: OperationInfo): Unit =
|
||||
withContext(dispatcherProvider.io) {
|
||||
val payloadString = json.encodeToString(operationInfo.payload)
|
||||
getQueries().insertOperation(
|
||||
aggregateType = operationInfo.type.name,
|
||||
actionType = operationInfo.actionType,
|
||||
payload = payloadString,
|
||||
createdAt = Clock.System.now().epochSeconds
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun insert(operationInfo: OperationInfo): Unit = withContext(dispatcherProvider.io) {
|
||||
val payloadString = json.encodeToString(operationInfo.payload)
|
||||
getQueries().insertOperation(
|
||||
aggregateType = operationInfo.type.name,
|
||||
actionType = operationInfo.actionType,
|
||||
payload = payloadString,
|
||||
createdAt = Clock.System.now().epochSeconds
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun clear(): Unit = withContext(dispatcherProvider.io) {
|
||||
getQueries().clear()
|
||||
|
||||
+5
-1
@@ -26,16 +26,20 @@ class RecentlyWatchedSyncStrategy(
|
||||
val info = json.decodeFromJsonElement<RecentlyWatchedInfo>(payload)
|
||||
remote.write(info)
|
||||
}
|
||||
|
||||
SyncClientServerRecentlyWatchedRepository.ACTION_REMOVE -> {
|
||||
val info = json.decodeFromJsonElement<RecentlyWatchedInfo>(payload)
|
||||
remote.remove(info)
|
||||
}
|
||||
|
||||
SyncClientServerRecentlyWatchedRepository.ACTION_WRITE_ALL -> {
|
||||
val payloadObj = payload.jsonObject
|
||||
val listElement = payloadObj[SyncClientServerRecentlyWatchedRepository.LIST] ?: error("Missing list key")
|
||||
val listElement = payloadObj[SyncClientServerRecentlyWatchedRepository.LIST]
|
||||
?: error("Missing list key")
|
||||
val list = json.decodeFromJsonElement<List<RecentlyWatchedInfo>>(listElement)
|
||||
remote.writeAll(list)
|
||||
}
|
||||
|
||||
else -> error("Unknown action type: $actionType")
|
||||
}
|
||||
}
|
||||
|
||||
+7
-2
@@ -29,20 +29,25 @@ class SavedMovieSyncStrategy(
|
||||
val details = json.decodeFromJsonElement<VideoDetails>(payload)
|
||||
remote.save(details)
|
||||
}
|
||||
|
||||
SyncClientSavedMovieRepository.ACTION_REMOVE -> {
|
||||
val id = payload.jsonObject[SyncClientSavedMovieRepository.KEY_ID]?.jsonPrimitive?.long
|
||||
?: error("Missing ${SyncClientSavedMovieRepository.KEY_ID}")
|
||||
val id =
|
||||
payload.jsonObject[SyncClientSavedMovieRepository.KEY_ID]?.jsonPrimitive?.long
|
||||
?: error("Missing ${SyncClientSavedMovieRepository.KEY_ID}")
|
||||
remote.remove(id)
|
||||
}
|
||||
|
||||
SyncClientSavedMovieRepository.ACTION_SAVE_ALL -> {
|
||||
val listElement = payload.jsonObject[SyncClientSavedMovieRepository.KEY_LIST]
|
||||
?: error("Missing ${SyncClientSavedMovieRepository.KEY_LIST}")
|
||||
val list = json.decodeFromJsonElement<List<VideoDetails>>(listElement)
|
||||
remote.saveAll(list)
|
||||
}
|
||||
|
||||
SyncClientSavedMovieRepository.ACTION_CLEAR -> {
|
||||
remote.clear()
|
||||
}
|
||||
|
||||
else -> error("Unknown action type: $actionType")
|
||||
}
|
||||
}
|
||||
|
||||
+8
-4
@@ -20,15 +20,19 @@ class SearchSyncStrategy(
|
||||
override suspend fun execute(actionType: String, payload: JsonElement) {
|
||||
when (actionType) {
|
||||
SyncClientServerSearchRepository.ACTION_ADD -> {
|
||||
val query = payload.jsonObject[SyncClientServerSearchRepository.KEY_QUERY]?.jsonPrimitive?.content
|
||||
?: error("Missing ${SyncClientServerSearchRepository.KEY_QUERY}")
|
||||
val query =
|
||||
payload.jsonObject[SyncClientServerSearchRepository.KEY_QUERY]?.jsonPrimitive?.content
|
||||
?: error("Missing ${SyncClientServerSearchRepository.KEY_QUERY}")
|
||||
remote.addToSearch(query)
|
||||
}
|
||||
|
||||
SyncClientServerSearchRepository.ACTION_DELETE -> {
|
||||
val query = payload.jsonObject[SyncClientServerSearchRepository.KEY_QUERY]?.jsonPrimitive?.content
|
||||
?: error("Missing ${SyncClientServerSearchRepository.KEY_QUERY}")
|
||||
val query =
|
||||
payload.jsonObject[SyncClientServerSearchRepository.KEY_QUERY]?.jsonPrimitive?.content
|
||||
?: error("Missing ${SyncClientServerSearchRepository.KEY_QUERY}")
|
||||
remote.deleteFromSearch(query)
|
||||
}
|
||||
|
||||
SyncClientServerSearchRepository.ACTION_CLEAR -> remote.clear()
|
||||
else -> error("Unknown action type: $actionType")
|
||||
}
|
||||
|
||||
+3
-1
@@ -3,7 +3,6 @@ package ru.shadowsparky.vbox.shared.data.sync.strategy
|
||||
import kotlinx.serialization.json.JsonElement
|
||||
import kotlinx.serialization.json.jsonObject
|
||||
import kotlinx.serialization.json.jsonPrimitive
|
||||
import kotlinx.serialization.json.long
|
||||
import org.koin.core.annotation.Factory
|
||||
import org.koin.core.annotation.Named
|
||||
import ru.shadowsparky.vbox.shared.data.tag.SyncUserTagRepository
|
||||
@@ -26,6 +25,7 @@ class UserTagSyncStrategy(
|
||||
?: error("Missing ${SyncUserTagRepository.KEY_TAG}")
|
||||
remote.add(tag)
|
||||
}
|
||||
|
||||
SyncUserTagRepository.ACTION_EDIT -> {
|
||||
val oldTag = payloadObj[SyncUserTagRepository.KEY_OLD_TAG]?.jsonPrimitive?.content
|
||||
?: error("Missing ${SyncUserTagRepository.KEY_OLD_TAG}")
|
||||
@@ -33,11 +33,13 @@ class UserTagSyncStrategy(
|
||||
?: error("Missing ${SyncUserTagRepository.KEY_NEW_TAG}")
|
||||
remote.edit(oldTag, newTag)
|
||||
}
|
||||
|
||||
SyncUserTagRepository.ACTION_DELETE -> {
|
||||
val oldTag = payloadObj[SyncUserTagRepository.KEY_OLD_TAG]?.jsonPrimitive?.content
|
||||
?: error("Missing ${SyncUserTagRepository.KEY_OLD_TAG}")
|
||||
remote.delete(oldTag)
|
||||
}
|
||||
|
||||
else -> error("Unknown action type: $actionType")
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -36,10 +36,11 @@ class RemoteUserTagRepository(
|
||||
private val dispatcherProvider: DispatcherProvider
|
||||
) : UserTagRepository {
|
||||
|
||||
override val userTags: Flow<List<TagInfo>> = userTagListener.event.filterIsInstance<RemoteEvent.OnUserTag>()
|
||||
.map { queryUserTagsSingle() }
|
||||
.onStart { emit(queryUserTagsSingle()) }
|
||||
.flowOn(dispatcherProvider.io)
|
||||
override val userTags: Flow<List<TagInfo>> =
|
||||
userTagListener.event.filterIsInstance<RemoteEvent.OnUserTag>()
|
||||
.map { queryUserTagsSingle() }
|
||||
.onStart { emit(queryUserTagsSingle()) }
|
||||
.flowOn(dispatcherProvider.io)
|
||||
|
||||
private suspend fun queryUserTagsSingle(): List<TagInfo> {
|
||||
return httpClient.get<TagResponse>(
|
||||
|
||||
+4
-2
@@ -48,13 +48,15 @@ class SyncMovieTagRepository(
|
||||
queryRemote = {
|
||||
val allTags = userTagRemote.userTags.first()
|
||||
allTags.flatMap { tag ->
|
||||
remote.queryMovies(tag.tag).first().map { movieId -> MovieTagLink(movieId, tag.tag) }
|
||||
remote.queryMovies(tag.tag).first()
|
||||
.map { movieId -> MovieTagLink(movieId, tag.tag) }
|
||||
}
|
||||
},
|
||||
queryLocal = {
|
||||
val allTags = userTagLocal.userTags.first()
|
||||
allTags.flatMap { tag ->
|
||||
local.queryMovies(tag.tag).first().map { movieId -> MovieTagLink(movieId, tag.tag) }
|
||||
local.queryMovies(tag.tag).first()
|
||||
.map { movieId -> MovieTagLink(movieId, tag.tag) }
|
||||
}
|
||||
},
|
||||
writeRemote = { list ->
|
||||
|
||||
+2
-1
@@ -34,7 +34,8 @@ class SavedModule {
|
||||
serverConfigurationRepository: ServerConfigurationRepository,
|
||||
@Named(EventType.SAVED) eventListener: RemoteEventListener
|
||||
): SavedMovieRepository {
|
||||
val impl = RemoteSavedMovieRepository(httpClient, serverConfigurationRepository, eventListener)
|
||||
val impl =
|
||||
RemoteSavedMovieRepository(httpClient, serverConfigurationRepository, eventListener)
|
||||
return PosterWithoutSuffixSavedMovieRepository(impl)
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -17,7 +17,8 @@ fun <T> TokenStorage.queryFlow(
|
||||
): Flow<T> {
|
||||
return flow {
|
||||
init()
|
||||
emitAll(if (hasAccount()) {
|
||||
emitAll(
|
||||
if (hasAccount()) {
|
||||
active.catch { emitAll(fallback) }
|
||||
} else {
|
||||
fallback
|
||||
|
||||
+4
-3
@@ -32,9 +32,10 @@ class OfflineVideoInteractor(
|
||||
seasonId,
|
||||
season.title,
|
||||
seasonEntry.value.mapNotNull { episode ->
|
||||
val links = fetchVideoLinks(episode.movieId, seasonId).seasons
|
||||
?.firstOrNull()
|
||||
?.episodes?.firstOrNull { it.episode == episode.episodeId }
|
||||
val links =
|
||||
fetchVideoLinks(episode.movieId, seasonId).seasons
|
||||
?.firstOrNull()
|
||||
?.episodes?.firstOrNull { it.episode == episode.episodeId }
|
||||
if (links == null) {
|
||||
null
|
||||
} else {
|
||||
|
||||
+5
-1
@@ -25,7 +25,11 @@ import ru.shadowsparky.vbox.shared.presentation.settings.SettingsContent
|
||||
fun MainScreen(route: Route, child: Child, rootComponent: RootComponent) {
|
||||
when (child) {
|
||||
is Child.SearchChild -> SearchScreen(child.component, route) { rootComponent.nav(it, true) }
|
||||
is Child.SavedMovieChild -> SavedMovieScreen(child.component, route) { rootComponent.navReplace(it) }
|
||||
is Child.SavedMovieChild -> SavedMovieScreen(
|
||||
child.component,
|
||||
route
|
||||
) { rootComponent.navReplace(it) }
|
||||
|
||||
else -> MainScreenInternal(route, child) { rootComponent.navReplace(it) }
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -35,7 +35,11 @@ sealed class Route : ru.shadowsparky.ui.nav.Route() {
|
||||
class Season(val id: Long, override val routeId: String = RouteIds.SELECT_SEASON) : Route()
|
||||
|
||||
@Serializable
|
||||
class Episode(val id: Long, val selectedSeasonId: Long, override val routeId: String = RouteIds.SELECT_EPISODE) : Route()
|
||||
class Episode(
|
||||
val id: Long,
|
||||
val selectedSeasonId: Long,
|
||||
override val routeId: String = RouteIds.SELECT_EPISODE
|
||||
) : Route()
|
||||
|
||||
@Serializable
|
||||
class Player(
|
||||
|
||||
+2
-1
@@ -80,7 +80,7 @@ fun OfflineVideoScreen(component: OfflineVideoComponent) {
|
||||
OfflineVideoInfoContent(
|
||||
padding,
|
||||
info ?: emptyList(),
|
||||
onVideoClick = { component.play(it) },
|
||||
onVideoClick = { component.play(it) },
|
||||
onDeleteClick = { component.remove(it) }
|
||||
)
|
||||
}
|
||||
@@ -139,6 +139,7 @@ private fun OfflineVideoInfoContent(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun MovieHeader(
|
||||
title: String,
|
||||
|
||||
+6
-1
@@ -192,7 +192,12 @@ class EpisodeOverviewFactory(
|
||||
api = api,
|
||||
recentlyWatchedRepository = recentlyWatchedRepository,
|
||||
clipboardManager = clipboardManager,
|
||||
offlineStorage = offlineStorage?.let { SessionOfflineStorage(it, addOfflineVideoUseCase) },
|
||||
offlineStorage = offlineStorage?.let {
|
||||
SessionOfflineStorage(
|
||||
it,
|
||||
addOfflineVideoUseCase
|
||||
)
|
||||
},
|
||||
dispatcherProvider = dispatcherProvider
|
||||
)
|
||||
return Child.EpisodeOverviewChild(comp)
|
||||
|
||||
+1
@@ -282,6 +282,7 @@ private fun RowScope.ShowOfflineIcon(offlineInfo: OfflineVideo?) {
|
||||
modifier = Modifier.align(Alignment.CenterVertically).size(32.dp)
|
||||
)
|
||||
}
|
||||
|
||||
else -> {
|
||||
when (state) {
|
||||
is OfflineState.Available -> Res.drawable.download_done
|
||||
|
||||
+1
@@ -68,6 +68,7 @@ class SessionOfflineStorage(
|
||||
result += operation.item
|
||||
}
|
||||
}
|
||||
|
||||
PendingOperation.Remove -> {
|
||||
result.removeAll { it.key() == key }
|
||||
}
|
||||
|
||||
+6
-1
@@ -54,6 +54,7 @@ fun PlayerScreen(component: PlayerComponent) {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
is PlayerEvent.Ended -> component.requestNextEpisode()
|
||||
is PlayerEvent.Playing -> {
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
@@ -68,12 +69,16 @@ fun PlayerScreen(component: PlayerComponent) {
|
||||
val savedMillis = (effect as? PlayerEffect.SavedTimeFound)?.millis
|
||||
PlayerActionOverlay(
|
||||
savedMillis != null,
|
||||
text = stringResource(Res.string.start_from, "${savedMillis?.toReadableTime()}")
|
||||
text = stringResource(
|
||||
Res.string.start_from,
|
||||
"${savedMillis?.toReadableTime()}"
|
||||
)
|
||||
) { component.load(savedMillis) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> Loading(Modifier.fillMaxSize())
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -137,7 +137,10 @@ fun SearchVideoContent(
|
||||
},
|
||||
onDeleteRequested = { component.removeFromSearch(it) })
|
||||
} else {
|
||||
Box(modifier = Modifier.fillMaxSize().padding(paddingValues), contentAlignment = Alignment.Center) {
|
||||
Box(
|
||||
modifier = Modifier.fillMaxSize().padding(paddingValues),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(Res.string.search_empty_now),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
|
||||
+3
-1
@@ -193,7 +193,9 @@ private fun EditTagBottomSheet(
|
||||
}
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
enabled = tagId != null && newTag.isNotEmpty() && newTag != tag.tag && canSave(newTag)
|
||||
enabled = tagId != null && newTag.isNotEmpty() && newTag != tag.tag && canSave(
|
||||
newTag
|
||||
)
|
||||
) { Text(stringResource(Res.string.user_tags_new_tag_save)) }
|
||||
OutlinedButton(
|
||||
onClick = {
|
||||
|
||||
Reference in New Issue
Block a user