mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-11-05 18:30:59 +01:00
Fix playlist & collection random sorting on home page (#1820)
## Description Ensure that a playlist or collection's items are random sorted on the home page, if applicable. Previously, the request did sort by random then by sort name resulting in only sorting by sort name. However, there are still issues with random sorting in general, see #1819 ### Related issues Technically fixes #1806 Further bugs in #1819 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
1c0e9a5853
commit
c6d81dada8
1 changed files with 14 additions and 4 deletions
|
|
@ -859,18 +859,28 @@ class HomeSettingsService
|
|||
sortBy =
|
||||
row.sort?.let {
|
||||
buildList {
|
||||
add(it.sort)
|
||||
if (it.sort != ItemSortBy.SORT_NAME) {
|
||||
if (it.sort == ItemSortBy.RANDOM) {
|
||||
add(ItemSortBy.SORT_NAME)
|
||||
add(ItemSortBy.RANDOM)
|
||||
} else {
|
||||
add(it.sort)
|
||||
if (it.sort != ItemSortBy.SORT_NAME) {
|
||||
add(ItemSortBy.SORT_NAME)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
sortOrder =
|
||||
row.sort?.let {
|
||||
buildList {
|
||||
add(it.direction)
|
||||
if (it.sort != ItemSortBy.SORT_NAME) {
|
||||
if (it.sort == ItemSortBy.RANDOM) {
|
||||
add(SortOrder.ASCENDING)
|
||||
add(it.direction)
|
||||
} else {
|
||||
add(it.direction)
|
||||
if (it.sort != ItemSortBy.SORT_NAME) {
|
||||
add(SortOrder.ASCENDING)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue