Added library sort by mean Tracker score (#10005)

This commit is contained in:
Caleb Morris
2023-11-04 12:31:59 -07:00
committed by GitHub
parent aca36f9625
commit 5d91b77c93
7 changed files with 49 additions and 15 deletions

View File

@@ -144,6 +144,13 @@ private fun ColumnScope.SortPage(
val sortingMode = category.sort.type
val sortDescending = !category.sort.isAscending
val trackerSortOption =
if (screenModel.trackers.isEmpty()) {
emptyList()
} else {
listOf(R.string.action_sort_tracker_score to LibrarySort.Type.TrackerMean)
}
listOf(
R.string.action_sort_alpha to LibrarySort.Type.Alphabetical,
R.string.action_sort_total to LibrarySort.Type.TotalChapters,
@@ -153,7 +160,7 @@ private fun ColumnScope.SortPage(
R.string.action_sort_latest_chapter to LibrarySort.Type.LatestChapter,
R.string.action_sort_chapter_fetch_date to LibrarySort.Type.ChapterFetchDate,
R.string.action_sort_date_added to LibrarySort.Type.DateAdded,
).map { (titleRes, mode) ->
).plus(trackerSortOption).map { (titleRes, mode) ->
SortItem(
label = stringResource(titleRes),
sortDescending = sortDescending.takeIf { sortingMode == mode },