Skip to content

Commit

Permalink
Correctly detect initial fetch of chapters (#689)
Browse files Browse the repository at this point in the history
Since the number of chapters gets converted to be index based, 1 available chapter would result in 0.

Due to this, in case a manga had exactly one chapter before updating the chapters, it was incorrectly detected as the initial fetch and the new chapters did not get automatically downloaded.
  • Loading branch information
schroda authored Sep 23, 2023
1 parent 0a73177 commit d81fafc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ object Chapter {
val numberOfNewChapters = updatedNumberOfChapters - currentNumberOfChapters

val areNewChaptersAvailable = numberOfNewChapters > 0
val wasInitialFetch = currentNumberOfChapters == 0
val wasInitialFetch = currentNumberOfChapters == -1 // has to be -1 - due to converting to index based 1 chapter will be 0

// make sure to ignore initial fetch
val isDownloadPossible =
Expand Down

0 comments on commit d81fafc

Please sign in to comment.