dont delete chapters in global update if the chapter number hasn't changed

(if the source doesnt have a scanlator it'll remain, for sources like dex etc it'll still delete it)
This commit is contained in:
Jays2Kings 2022-05-06 03:30:26 -04:00
parent 81fce93000
commit a3bff454fb

View file

@ -433,7 +433,10 @@ class LibraryUpdateService(
} }
if (deleteRemoved && newChapters.second.isNotEmpty()) { if (deleteRemoved && newChapters.second.isNotEmpty()) {
val removedChapters = newChapters.second.filter { val removedChapters = newChapters.second.filter {
downloadManager.isChapterDownloaded(it, manga) downloadManager.isChapterDownloaded(it, manga) &&
newChapters.first.none { newChapter ->
newChapter.chapter_number == it.chapter_number && it.scanlator.isNullOrBlank()
}
} }
if (removedChapters.isNotEmpty()) { if (removedChapters.isNotEmpty()) {
downloadManager.deleteChapters(removedChapters, manga, source) downloadManager.deleteChapters(removedChapters, manga, source)