Compare commits

...

10 commits

Author SHA1 Message Date
Damontecres
2d87d526db
Release v1.0.9
Some checks failed
Development build / build (push) Has been cancelled
Create release / publish (push) Has been cancelled
2026-10-11 17:15:01 -04:00
Damontecres
5bfbba193a
Fix issue with home reloading on user switch (#2064)
## Description
When switching users, the current user's home page would start a reload
during the switch. This PR fixes that by comparing the user switch.

The underlying cause is that Room's flow is blunt and emits whenever the
table updates. So [during the user
switch](9b02804075/app/src/main/java/com/github/damontecres/wholphin/data/ServerRepository.kt (L117-L118))
the table is updated causing [current user to
emit](9b02804075/app/src/main/java/com/github/damontecres/wholphin/data/ServerRepository.kt (L71))
and the current user flow is updated causing the new user to emit.

### Related issues
N/A

### Testing
Emulator, switching users and switching locales

Can observe that `UserSwitchListener` only trigger once per user switch
instead of twice

## Screenshots
N/A

## AI or LLM usage
None
2026-10-11 09:59:50 -04:00
Damontecres
9b02804075
Translations 2026-10 -10 (#2054)
Updates translations as of 2026-10-10

Thanks to everyone who contributed!

---------

Co-authored-by: n8llcaster <n8llcaster@noreply.codeberg.org>
Co-authored-by: SimonHung <simonhung@noreply.codeberg.org>
Co-authored-by: Sk4hnt42 <sk4hnt42@noreply.codeberg.org>
Co-authored-by: Priit Jõerüüt <jrtcdbrg@noreply.codeberg.org>
Co-authored-by: American_Jesus <american_jesus@noreply.codeberg.org>
Co-authored-by: idezentas <idezentas@noreply.codeberg.org>
Co-authored-by: Greeg0ry <greeg0ry@noreply.codeberg.org>
Co-authored-by: MrGegaz <mrgegaz@noreply.codeberg.org>
Co-authored-by: Andi Chandler <andi@gowling.com>
Co-authored-by: Prahlis <prahlis@noreply.codeberg.org>
Co-authored-by: SergeiAK <sergeiak@noreply.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: danpergal84 <danpergal84@noreply.codeberg.org>
Co-authored-by: TheMatrixan <thematrixan@noreply.codeberg.org>
2026-10-10 20:39:02 -04:00
Prahlis
1571591a12
Translated using Weblate (Swedish)
Currently translated at 94.9% (626 of 659 strings)

Translation: Wholphin/Wholphin
Translate-URL: https://translate.codeberg.org/projects/wholphin/wholphin/sv/
2026-10-10 10:52:06 +00:00
TheMatrixan
db77aaa3a4
Translated using Weblate (Polish)
Currently translated at 100.0% (659 of 659 strings)

Translation: Wholphin/Wholphin
Translate-URL: https://translate.codeberg.org/projects/wholphin/wholphin/pl/
2026-10-10 10:52:06 +00:00
Prahlis
55d3254b1e
Translated using Weblate (Swedish)
Currently translated at 94.8% (625 of 659 strings)

Translation: Wholphin/Wholphin
Translate-URL: https://translate.codeberg.org/projects/wholphin/wholphin/sv/
2026-10-10 10:52:06 +00:00
danpergal84
f14e5a5756
Translated using Weblate (Spanish)
Currently translated at 100.0% (659 of 659 strings)

Translation: Wholphin/Wholphin
Translate-URL: https://translate.codeberg.org/projects/wholphin/wholphin/es/
2026-10-10 10:52:06 +00:00
danpergal84
68c48f154c
Translated using Weblate (Spanish)
Currently translated at 100.0% (659 of 659 strings)

Translation: Wholphin/Wholphin
Translate-URL: https://translate.codeberg.org/projects/wholphin/wholphin/es/
2026-10-10 10:52:06 +00:00
Outbreak2096
c879a5713f
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (659 of 659 strings)

Translation: Wholphin/Wholphin
Translate-URL: https://translate.codeberg.org/projects/wholphin/wholphin/zh_Hans/
2026-10-10 10:52:06 +00:00
SergeiAK
6308ad85a9
Translated using Weblate (Russian)
Currently translated at 100.0% (659 of 659 strings)

Translation: Wholphin/Wholphin
Translate-URL: https://translate.codeberg.org/projects/wholphin/wholphin/ru/
2026-10-10 10:52:06 +00:00
7 changed files with 39 additions and 14 deletions

View file

@ -17,6 +17,7 @@ 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
@ -68,7 +69,9 @@ class ServerRepository
_current
.flatMapLatest { user ->
if (user?.user != null) {
serverDao.getUserFlow(user.user.serverId, user.user.id)
serverDao
.getUserFlow(user.user.serverId, user.user.id)
.distinctUntilChanged()
} else {
flow { emit(null) }
}

View file

@ -15,6 +15,8 @@ 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
@ -38,14 +40,17 @@ class UserSwitchListener
init {
context as AppCompatActivity
context.lifecycleScope.launchDefault {
serverRepository.currentUserFlow.collect { user ->
Timber.d("New user")
seerrServerRepository.clear()
homeSettingsService.currentSettings.update { HomePageResolvedSettings.EMPTY }
if (user != null) {
switchUser(user)
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)
}
}
}
}
}

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">Aleatorio</string>
<string name="sort_by_random">Selección aleatoria</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">Aleatorio</string>
<string name="shuffle">Reproducción aleatoria</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,4 +738,7 @@
<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,4 +761,6 @@
<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">Trickplay</string>
<string name="dpad_seek_mode_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,4 +684,6 @@
<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,4 +687,14 @@
<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>