Compare commits

..

No commits in common. "2d87d526dbfabd94c5033e16d14c215b206e8b10" and "ba5351f8dcb104149bf375a59f51b4717466a7b5" have entirely different histories.

7 changed files with 14 additions and 39 deletions

View file

@ -17,7 +17,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.map
@ -69,9 +68,7 @@ class ServerRepository
_current
.flatMapLatest { user ->
if (user?.user != null) {
serverDao
.getUserFlow(user.user.serverId, user.user.id)
.distinctUntilChanged()
serverDao.getUserFlow(user.user.serverId, user.user.id)
} else {
flow { emit(null) }
}

View file

@ -15,8 +15,6 @@ import com.github.damontecres.wholphin.ui.launchIO
import com.github.damontecres.wholphin.util.WholphinDispatchers
import dagger.hilt.android.qualifiers.ActivityContext
import dagger.hilt.android.scopes.ActivityScoped
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.supervisorScope
import kotlinx.coroutines.withContext
@ -40,17 +38,14 @@ class UserSwitchListener
init {
context as AppCompatActivity
context.lifecycleScope.launchDefault {
serverRepository.currentUserFlow
.distinctUntilChanged { old, new ->
old?.id == new?.id && old?.uiLanguage == new?.uiLanguage
}.collectLatest { user ->
Timber.d("UserSwitch: %s", user?.id)
seerrServerRepository.clear()
homeSettingsService.currentSettings.update { HomePageResolvedSettings.EMPTY }
if (user != null) {
switchUser(user)
}
serverRepository.currentUserFlow.collect { user ->
Timber.d("New user")
seerrServerRepository.clear()
homeSettingsService.currentSettings.update { HomePageResolvedSettings.EMPTY }
if (user != null) {
switchUser(user)
}
}
}
}

View file

@ -55,7 +55,7 @@
<string name="select_server">Seleccionar servidor</string>
<string name="select_user">Seleccionar Usuario</string>
<string name="sort_by_name">Nombre</string>
<string name="sort_by_random">Selección aleatoria</string>
<string name="sort_by_random">Aleatorio</string>
<string name="studios">Estudios</string>
<string name="submit">Enviar</string>
<string name="subtitle">Subtítulo</string>
@ -105,7 +105,7 @@
<string name="remove_favorite">Quitar de favoritos</string>
<string name="show_debug_info">Mostrar información de depuración</string>
<string name="show">Mostrar</string>
<string name="shuffle">Reproducción aleatoria</string>
<string name="shuffle">Aleatorio</string>
<string name="skip">Saltar</string>
<string name="sort_by_date_episode_added">Ordenar por fecha de inclusión del episodio</string>
<string name="about">Acerca de</string>
@ -738,7 +738,4 @@
<string name="season_episode_number_padded_range">T%1$02dE%2$02d-E%3$02d</string>
<string name="episode_number_short">E%1$d</string>
<string name="season_number">Temporada %1$d</string>
<string name="remove_from_playlist">Eliminar de la lista de reproducción</string>
<string name="login_credentials_expired">Credenciales caducadas, vuelve a iniciar sesión</string>
<string name="login_not_authorized">No tienes autorización para acceder al servidor en este momento</string>
</resources>

View file

@ -761,6 +761,4 @@
<string name="season_episode_number_range">S%1$d O%2$d-%3$d</string>
<string name="season_episode_number_padded">S%1$02d O%2$02d</string>
<string name="season_episode_number_padded_range">S%1$02d O%2$02d-%3$02d</string>
<string name="disable_audio_offload">Wyłącz sprzętowe wsparcie dźwięku</string>
<string name="disable_audio_offload_summary">Wyłączenie sprzętowego wsparcie dźwięku może naprawić błąd z zatrzymaniem się odtwarzania na niektórych urządzeniach</string>
</resources>

View file

@ -91,7 +91,7 @@
<string name="studios">Студии</string>
<string name="subtitle">Субтитры</string>
<string name="subtitles">Субтитры</string>
<string name="suggestions">Предложения</string>
<string name="suggestions">Рекомендации</string>
<string name="switch_servers">Сменить сервер</string>
<string name="switch_user">Сменить</string>
<string name="top_unwatched">Лучшие из непросмотренных</string>
@ -728,7 +728,7 @@
<string name="video_tunneling">Туннелирование видео</string>
<string name="d_pad_seek_mode_title">Вид полосы перемотки при нажатии кнопок пульта</string>
<string name="dpad_seek_mode_minimal">Минимальный</string>
<string name="dpad_seek_mode_trickplay">Превью при перемотке</string>
<string name="dpad_seek_mode_trickplay">Trickplay</string>
<string name="dpad_seek_mode_minimal_summary">Небольшая полоса перемотки внизу экрана (по умолчанию)</string>
<string name="dpad_seek_mode_trickplay_summary">Полоса перемотки с миниатюрами кадров (Trickplay)</string>
<string name="dpad_seek_mode_none_summary">Без полосы перемотки</string>
@ -759,8 +759,8 @@
<string name="dim_percentage">Процент затемнения</string>
<string name="dim_screen">Затемнение экрана</string>
<string name="photo_albums">Фотоальбомы</string>
<string name="no_favorites_found">В избранном пока ничего нет!</string>
<string name="no_favorites_found">В избранном пока ничего нет</string>
<string name="remove_from_playlist">Убрать из плейлиста</string>
<string name="login_credentials_expired">Срок действия учётных данных истёк. Пожалуйста, войдите снова</string>
<string name="login_credentials_expired">Срок действия учётных данных истёк. Пожалуйста, войдите снова.</string>
<string name="login_not_authorized">У вас нет доступа к серверу в данный момент</string>
</resources>

View file

@ -684,6 +684,4 @@
<string name="recordings">Inspelningar</string>
<string name="folders_title">Mappar</string>
<string name="user_views">Användarvisningar</string>
<string name="genre_movies">%1$sfilmer</string>
<string name="quality_profile">Kvalitetsprofil</string>
</resources>

View file

@ -687,14 +687,4 @@
<string name="dim_screen">调暗屏幕</string>
<string name="photo_albums">相册</string>
<string name="no_favorites_found">未找到收藏!</string>
<string name="duration_hours_seconds">%1$d小时%2$d秒</string>
<string name="season_episode_number">第%1$d季 第%2$d集</string>
<string name="season_episode_number_range">第%1$d季 第%2$d-%3$d集</string>
<string name="season_episode_number_padded">第%1$02d季第%2$02d集</string>
<string name="season_episode_number_padded_range">第%1$02d季第%2$02d-%3$02d集</string>
<string name="episode_number_short">第%1$d集</string>
<string name="season_number">第%1$d季</string>
<string name="remove_from_playlist">从播放列表中移除</string>
<string name="login_credentials_expired">凭据已过期,请重新登录</string>
<string name="login_not_authorized">您目前无权访问该服务器</string>
</resources>