Fix duplicate chapters in some sources

Fixes #714
This commit is contained in:
Jays2Kings 2021-04-09 12:14:33 -04:00
parent 3e7ad9dbd3
commit d3a1d8a8a9

View File

@ -36,7 +36,9 @@ fun syncChaptersWithSource(
// Chapters from db.
val dbChapters = db.getChapters(manga).executeAsBlocking()
val sourceChapters = rawSourceChapters.mapIndexed { i, sChapter ->
val sourceChapters = rawSourceChapters
.distinctBy { it.url }
.mapIndexed { i, sChapter ->
Chapter.create().apply {
copyFrom(sChapter)
manga_id = manga.id