mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Don't query for Live TV info if user does not have access (#286)
Fixes #281
This commit is contained in:
parent
99e8b69c0e
commit
ccc900cee7
2 changed files with 24 additions and 30 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue