Merge pull request #1398 from lkiesow/dont-list-book-twice

Don't list book twice in continue series
This commit is contained in:
advplyr 2023-01-13 14:02:53 -06:00 committed by GitHub
commit 702ee3d350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -672,10 +672,12 @@ module.exports = {
} }
const indexToPut = categoryMap.continueSeries.items.findIndex(i => i.prevBookInProgressLastUpdate < bookForContinueSeries.prevBookInProgressLastUpdate) const indexToPut = categoryMap.continueSeries.items.findIndex(i => i.prevBookInProgressLastUpdate < bookForContinueSeries.prevBookInProgressLastUpdate)
if (indexToPut >= 0) { if (!categoryMap.continueSeries.items.find(book => book.id === bookForContinueSeries.id)) {
categoryMap.continueSeries.items.splice(indexToPut, 0, bookForContinueSeries) if (indexToPut >= 0) {
} else if (categoryMap.continueSeries.items.length < 10) { // Max 10 books categoryMap.continueSeries.items.splice(indexToPut, 0, bookForContinueSeries)
categoryMap.continueSeries.items.push(bookForContinueSeries) } else if (categoryMap.continueSeries.items.length < 10) { // Max 10 books
categoryMap.continueSeries.items.push(bookForContinueSeries)
}
} }
} }
} }