mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-10 06:42:07 +01:00
Prevent IndexOutOfBoundsException when removing duplicated chapters (#935)
In case the "new" chapters consisted only of re-uploads an out of bound exception was thrown
This commit is contained in:
@@ -370,7 +370,7 @@ object Chapter {
|
||||
val actualNewChapters = newChapters.subtract(reUploadedChapters.toSet()).toList()
|
||||
val chaptersToConsiderForDownloadLimit =
|
||||
if (serverConfig.autoDownloadIgnoreReUploads.value) {
|
||||
actualNewChapters.removeDuplicates(actualNewChapters[0])
|
||||
if (actualNewChapters.isNotEmpty()) actualNewChapters.removeDuplicates(actualNewChapters[0]) else emptyList()
|
||||
} else {
|
||||
newChapters.removeDuplicates(newChapters[0])
|
||||
}.sortedBy { it.index }
|
||||
|
||||
Reference in New Issue
Block a user