fix(chapter): Distinct by url again

This commit is contained in:
Ahmad Ansori Palembani 2024-12-15 09:22:16 +07:00
parent 1bbfd97b30
commit 834958a819
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -137,7 +137,7 @@ suspend fun syncChaptersWithSource(
// Date fetch is set in such a way that the upper ones will have bigger value than the lower ones
// Sources MUST return the chapters from most to less recent, which is common.
var itemCount = toAdd.size
var updatedToAdd = toAdd.map { toAddItem ->
var updatedToAdd = toAdd.distinctBy { it.url }.map { toAddItem ->
val chapter: Chapter = toAddItem.copy()
chapter.date_fetch = now + itemCount--