Fix some bugs on discover pages (#1832)

## Description
Fix some bugs on discover pages:
- UI fixes for available seasons
- Fix toggle not updating when removing a season from a pending request
- Don't request images if the path is null
- Better error handling when fetching ratings

### Related issues
Follow up to #1816

### Testing
Emulator

## Screenshots
N/A

## AI or LLM usage
None
This commit is contained in:
Damontecres 2026-08-13 13:57:51 -04:00 • committed by GitHub
parent ba52915cf0
commit 2110d846c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 112 additions and 49 deletions

View file

@ -184,21 +184,23 @@ class SeerrService
)
}
}
val current = seerrServerRepository.current.firstOrNull() ?: return null
val cacheImages = current.serverConfig.cacheImages == true
val base =
if (cacheImages) {
current.server.url.removeSuffix("/") + "/imageproxy/tmdb"
} else {
"https://image.tmdb.org"
}
val prefix =
when (imageType) {
ImageType.PRIMARY -> "/t/p/w500"
ImageType.BACKDROP -> "/t/p/w${backdropWidth}_and_h${backdropHeight}_multi_faces"
else -> throw IllegalArgumentException("Image type not supported: $imageType")
}
return "${base}${prefix}$path"
return path?.takeIf { it.isNotNullOrBlank() }?.let {
val current = seerrServerRepository.current.firstOrNull() ?: return null
val cacheImages = current.serverConfig.cacheImages == true
val base =
if (cacheImages) {
current.server.url.removeSuffix("/") + "/imageproxy/tmdb"
} else {
"https://image.tmdb.org"
}
val prefix =
when (imageType) {
ImageType.PRIMARY -> "/t/p/w500"
ImageType.BACKDROP -> "/t/p/w${backdropWidth}_and_h${backdropHeight}_multi_faces"
else -> throw IllegalArgumentException("Image type not supported: $imageType")
}
return "${base}${prefix}$path"
}
}
suspend fun getProfilesAndFolders(type: SeerrItemType): SeerrRequestData {