mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 22:01:51 +01:00
Filter out chapter entries with duplicate URLs (fixes #3552)
This commit is contained in:
parent
e381d9fc8e
commit
0d15cbe334
@ -36,13 +36,15 @@ fun syncChaptersWithSource(
|
|||||||
// Chapters from db.
|
// Chapters from db.
|
||||||
val dbChapters = db.getChapters(manga).executeAsBlocking()
|
val dbChapters = db.getChapters(manga).executeAsBlocking()
|
||||||
|
|
||||||
val sourceChapters = rawSourceChapters.mapIndexed { i, sChapter ->
|
val sourceChapters = rawSourceChapters
|
||||||
Chapter.create().apply {
|
.distinctBy { it.url }
|
||||||
copyFrom(sChapter)
|
.mapIndexed { i, sChapter ->
|
||||||
manga_id = manga.id
|
Chapter.create().apply {
|
||||||
source_order = i
|
copyFrom(sChapter)
|
||||||
|
manga_id = manga.id
|
||||||
|
source_order = i
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Chapters from the source not in db.
|
// Chapters from the source not in db.
|
||||||
val toAdd = mutableListOf<Chapter>()
|
val toAdd = mutableListOf<Chapter>()
|
||||||
|
Loading…
Reference in New Issue
Block a user