Fixes to default home view options for music & videos (#1926)

## Description
This PR fixes how cards are displayed initially when creating the
default home page or loading it from the web config:
- Ensure view options are selected based on the library type (this is
how it's done already when manually adding a row)
- Support more home row types such as photos and music

### Related issues
Fixes https://github.com/damontecres/Wholphin/issues/1838

### Testing
Emulator, resetting to default and loading from web config

## Screenshots
N/A, music cards will be square instead of poster sized

## AI or LLM usage
None
This commit is contained in:
Damontecres 2026-09-01 17:52:47 -04:00 • committed by GitHub
parent cedca9b2b1
commit 6fbf6209a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 68 additions and 43 deletions

View file

@ -34,7 +34,7 @@ import com.github.damontecres.wholphin.services.UserPreferencesService
import com.github.damontecres.wholphin.services.getRecentlyAddedTitle
import com.github.damontecres.wholphin.services.hilt.IoCoroutineScope
import com.github.damontecres.wholphin.services.tvAccess
import com.github.damontecres.wholphin.ui.AspectRatio
import com.github.damontecres.wholphin.services.viewOptionsForCollectionType
import com.github.damontecres.wholphin.ui.formatTypeName
import com.github.damontecres.wholphin.ui.launchDefault
import com.github.damontecres.wholphin.ui.launchIO
@ -275,24 +275,7 @@ class HomeSettingsViewModel
rowType: LibraryRowType,
): Job =
viewModelScope.launchIO {
val viewOptions =
when (library.collectionType) {
CollectionType.MUSIC -> {
HomeRowViewOptions(aspectRatio = AspectRatio.SQUARE)
}
CollectionType.HOMEVIDEOS,
CollectionType.MUSICVIDEOS,
-> {
HomeRowViewOptions(
aspectRatio = AspectRatio.WIDE,
)
}
else -> {
HomeRowViewOptions()
}
}
val viewOptions = viewOptionsForCollectionType(library.collectionType)
val id = idCounter++
val newRow =
when (rowType) {