Correctly calculate the first chapter to download index (#796)
Subtracting 1 from the first chapter to download index caused an additional chapter to get downloaded (e.g. limit 4 would download 5 chapters)
Regression was introduced with 05bf4f5525
This commit is contained in:
@@ -308,7 +308,6 @@ object Chapter {
|
||||
")",
|
||||
)
|
||||
|
||||
// convert numbers to be index based
|
||||
val newNumberOfChapters = updatedChapterList.size
|
||||
val numberOfNewChapters = newNumberOfChapters - prevNumberOfChapters
|
||||
|
||||
@@ -340,7 +339,7 @@ object Chapter {
|
||||
|
||||
val firstChapterToDownloadIndex =
|
||||
if (serverConfig.autoDownloadAheadLimit.value > 0) {
|
||||
(numberOfNewChapters - serverConfig.autoDownloadAheadLimit.value - 1).coerceAtLeast(0)
|
||||
(numberOfNewChapters - serverConfig.autoDownloadAheadLimit.value).coerceAtLeast(0)
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user