Fix "Old" sort type for multi communities

This commit is contained in:
Balazs Toldi 2024-01-06 11:20:30 +01:00
parent 0fd7203fa3
commit 133dc4a69c
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58

View File

@ -12,6 +12,7 @@ import eu.toldi.infinityforlemmy.post.Post
import eu.toldi.infinityforlemmy.post.enrich.PostEnricher import eu.toldi.infinityforlemmy.post.enrich.PostEnricher
import eu.toldi.infinityforlemmy.postfilter.PostFilter import eu.toldi.infinityforlemmy.postfilter.PostFilter
import eu.toldi.infinityforlemmy.utils.MultiCommunityUtils.sortByNewest import eu.toldi.infinityforlemmy.utils.MultiCommunityUtils.sortByNewest
import eu.toldi.infinityforlemmy.utils.MultiCommunityUtils.sortByOldest
import eu.toldi.infinityforlemmy.utils.MultiCommunityUtils.sortByScore import eu.toldi.infinityforlemmy.utils.MultiCommunityUtils.sortByScore
import retrofit2.HttpException import retrofit2.HttpException
import retrofit2.Response import retrofit2.Response
@ -79,6 +80,10 @@ class MulticommunityPagingSource(
sortByNewest(combinedPosts) sortByNewest(combinedPosts)
} }
SortType.Type.OLD -> {
sortByOldest(combinedPosts)
}
SortType.Type.TOP_ALL, SortType.Type.TOP_YEAR, SortType.Type.TOP_NINE_MONTHS, SortType.Type.TOP_SIX_MONTHS, SortType.Type.TOP_THREE_MONTHS, SortType.Type.TOP_MONTH, SortType.Type.TOP_WEEK, SortType.Type.TOP_DAY, SortType.Type.TOP_TWELVE_HOURS, SortType.Type.TOP_SIX_HOURS, SortType.Type.TOP_HOUR SortType.Type.TOP_ALL, SortType.Type.TOP_YEAR, SortType.Type.TOP_NINE_MONTHS, SortType.Type.TOP_SIX_MONTHS, SortType.Type.TOP_THREE_MONTHS, SortType.Type.TOP_MONTH, SortType.Type.TOP_WEEK, SortType.Type.TOP_DAY, SortType.Type.TOP_TWELVE_HOURS, SortType.Type.TOP_SIX_HOURS, SortType.Type.TOP_HOUR
-> sortByScore(combinedPosts) -> sortByScore(combinedPosts)