mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-23 20:34:40 +02:00
Merge pull request #1398 from lkiesow/dont-list-book-twice
Don't list book twice in continue series
This commit is contained in:
commit
702ee3d350
1 changed files with 6 additions and 4 deletions
|
@ -672,10 +672,12 @@ module.exports = {
|
|||
}
|
||||
|
||||
const indexToPut = categoryMap.continueSeries.items.findIndex(i => i.prevBookInProgressLastUpdate < bookForContinueSeries.prevBookInProgressLastUpdate)
|
||||
if (indexToPut >= 0) {
|
||||
categoryMap.continueSeries.items.splice(indexToPut, 0, bookForContinueSeries)
|
||||
} else if (categoryMap.continueSeries.items.length < 10) { // Max 10 books
|
||||
categoryMap.continueSeries.items.push(bookForContinueSeries)
|
||||
if (!categoryMap.continueSeries.items.find(book => book.id === bookForContinueSeries.id)) {
|
||||
if (indexToPut >= 0) {
|
||||
categoryMap.continueSeries.items.splice(indexToPut, 0, bookForContinueSeries)
|
||||
} else if (categoryMap.continueSeries.items.length < 10) { // Max 10 books
|
||||
categoryMap.continueSeries.items.push(bookForContinueSeries)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue