Adjust sort options

This commit is contained in:
Damontecres 2026-02-28 21:23:29 -05:00
parent d37c7604d2
commit 6a1725fd3d
No known key found for this signature in database
3 changed files with 57 additions and 11 deletions

View file

@ -99,6 +99,45 @@ val BoxSetSortOptions =
ItemSortBy.RANDOM,
)
val AlbumSortOptions =
listOf(
ItemSortBy.SORT_NAME,
ItemSortBy.PREMIERE_DATE,
ItemSortBy.DATE_CREATED,
ItemSortBy.DATE_PLAYED,
ItemSortBy.ALBUM_ARTIST,
ItemSortBy.COMMUNITY_RATING,
ItemSortBy.CRITIC_RATING,
ItemSortBy.RANDOM,
)
val ArtistSortOptions =
listOf(
ItemSortBy.SORT_NAME,
ItemSortBy.PREMIERE_DATE,
ItemSortBy.DATE_CREATED,
ItemSortBy.DATE_PLAYED,
ItemSortBy.COMMUNITY_RATING,
ItemSortBy.CRITIC_RATING,
ItemSortBy.RANDOM,
)
val SongSortOptions =
listOf(
ItemSortBy.SORT_NAME,
ItemSortBy.PREMIERE_DATE,
ItemSortBy.ALBUM,
ItemSortBy.ALBUM_ARTIST,
ItemSortBy.ARTIST,
ItemSortBy.DATE_CREATED,
ItemSortBy.DATE_PLAYED,
ItemSortBy.COMMUNITY_RATING,
ItemSortBy.CRITIC_RATING,
ItemSortBy.PLAY_COUNT,
ItemSortBy.RUNTIME,
ItemSortBy.RANDOM,
)
@StringRes
fun getStringRes(sort: ItemSortBy): Int =
when (sort) {
@ -132,5 +171,11 @@ fun getStringRes(sort: ItemSortBy): Int =
ItemSortBy.DEFAULT -> R.string.default_track
ItemSortBy.ALBUM -> R.string.album
ItemSortBy.ALBUM_ARTIST -> R.string.album_artist
ItemSortBy.ARTIST -> R.string.artist
else -> throw IllegalArgumentException("Unsupported sort option: $sort")
}

View file

@ -1,10 +1,8 @@
package com.github.damontecres.wholphin.ui.detail
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.animation.expandVertically
import androidx.compose.animation.shrinkVertically
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
@ -32,8 +30,9 @@ import com.github.damontecres.wholphin.ui.components.GenreCardGrid
import com.github.damontecres.wholphin.ui.components.RecommendedMusic
import com.github.damontecres.wholphin.ui.components.TabRow
import com.github.damontecres.wholphin.ui.components.ViewOptionsSquare
import com.github.damontecres.wholphin.ui.data.MovieSortOptions
import com.github.damontecres.wholphin.ui.data.VideoSortOptions
import com.github.damontecres.wholphin.ui.data.AlbumSortOptions
import com.github.damontecres.wholphin.ui.data.ArtistSortOptions
import com.github.damontecres.wholphin.ui.data.SongSortOptions
import com.github.damontecres.wholphin.ui.logTab
import com.github.damontecres.wholphin.ui.nav.Destination
import com.github.damontecres.wholphin.ui.preferences.PreferencesViewModel
@ -77,8 +76,8 @@ fun CollectionFolderMusic(
) {
AnimatedVisibility(
showHeader,
enter = slideInVertically() + fadeIn(),
exit = slideOutVertically() + fadeOut(),
enter = expandVertically(),
exit = shrinkVertically(),
) {
TabRow(
selectedTabIndex = selectedTabIndex,
@ -125,7 +124,7 @@ fun CollectionFolderMusic(
),
showTitle = false,
recursive = true,
sortOptions = MovieSortOptions,
sortOptions = AlbumSortOptions,
defaultViewOptions = ViewOptionsSquare,
modifier =
Modifier
@ -157,7 +156,7 @@ fun CollectionFolderMusic(
),
showTitle = false,
recursive = true,
sortOptions = VideoSortOptions,
sortOptions = ArtistSortOptions,
defaultViewOptions = ViewOptionsSquare,
modifier =
Modifier
@ -201,7 +200,7 @@ fun CollectionFolderMusic(
),
showTitle = false,
recursive = true,
sortOptions = MovieSortOptions,
sortOptions = SongSortOptions,
defaultViewOptions = ViewOptionsSquare,
modifier =
Modifier

View file

@ -724,5 +724,7 @@
<string name="mixer">Mixer</string>
<string name="creator">Creator</string>
<string name="artist">Artist</string>
<string name="album_artist">Album artist</string>
<string name="album">Album</string>
</resources>