Change return value of SyncChaptersWithSource.await() (#7715)

* Change return value of `SyncChaptersWithSource.await()`

`updatedToAdd.subtract(reAdded).toList()` never worked as at this point `updatedToAdd` contained ids from db where `reAdded` had default one. Was the same case before the rewrite.

Removed `toDelete` from return value as it was not being used anywhere

* Add doc string

* Use HashSet

Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>

Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>
(cherry picked from commit 11f640cfee)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
This commit is contained in:
AntsyLich
2022-08-11 19:06:46 +06:00
committed by Jobobby04
parent e9829129ae
commit 0b1afc1b94
5 changed files with 23 additions and 17 deletions
@@ -209,7 +209,7 @@ class EHentaiUpdateWorker(private val context: Context, workerParams: WorkerPara
val newChapters = source.getChapterList(manga.toMangaInfo())
.map { it.toSChapter() }
val (new, _) = syncChaptersWithSource.await(newChapters, manga, source)
val new = syncChaptersWithSource.await(newChapters, manga, source)
return new to getChapterByMangaId.await(manga.id)
} catch (t: Throwable) {
if (t is EHentai.GalleryNotFoundException) {