mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-10 14:52:05 +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 actualNewChapters = newChapters.subtract(reUploadedChapters.toSet()).toList()
|
||||||
val chaptersToConsiderForDownloadLimit =
|
val chaptersToConsiderForDownloadLimit =
|
||||||
if (serverConfig.autoDownloadIgnoreReUploads.value) {
|
if (serverConfig.autoDownloadIgnoreReUploads.value) {
|
||||||
actualNewChapters.removeDuplicates(actualNewChapters[0])
|
if (actualNewChapters.isNotEmpty()) actualNewChapters.removeDuplicates(actualNewChapters[0]) else emptyList()
|
||||||
} else {
|
} else {
|
||||||
newChapters.removeDuplicates(newChapters[0])
|
newChapters.removeDuplicates(newChapters[0])
|
||||||
}.sortedBy { it.index }
|
}.sortedBy { it.index }
|
||||||
|
|||||||
Reference in New Issue
Block a user