Don't query for Live TV info if user does not have access (#286)

Fixes #281
This commit is contained in:
damontecres 2025-11-21 13:15:52 -05:00 committed by GitHub
parent 99e8b69c0e
commit ccc900cee7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 30 deletions

View file

@ -27,16 +27,24 @@ class NavDrawerItemRepository
) {
suspend fun getNavDrawerItems(): List<NavDrawerItem> {
val user = serverRepository.currentUser.value
val tvAccess =
serverRepository.currentUserDto.value
?.policy
?.enableLiveTvAccess ?: false
val userViews =
api.userViewsApi
.getUserViews(userId = user?.id)
.content.items
val recordingFolders =
api.liveTvApi
.getRecordingFolders(userId = user?.id)
.content.items
.map { it.id }
.toSet()
if (tvAccess) {
api.liveTvApi
.getRecordingFolders(userId = user?.id)
.content.items
.map { it.id }
.toSet()
} else {
setOf()
}
val builtins = listOf(NavDrawerItem.Favorites)
val libraries =