mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-14 13:47:16 +02:00
Add a second to bulk chapters so its valid
This will enable users to go in and fix the chapter timing later but still save easily with the bulk import.
This commit is contained in:
parent
679ffed0ea
commit
54815ea9c7
@ -922,14 +922,13 @@ export default {
|
||||
|
||||
const { before, after, startingNumber } = this.detectedPattern
|
||||
const lastChapter = this.newChapters[this.newChapters.length - 1]
|
||||
const baseStart = lastChapter ? lastChapter.end : 0
|
||||
const defaultDuration = 300 // 5 minutes per chapter
|
||||
const baseStart = lastChapter ? lastChapter.start + 1 : 0
|
||||
|
||||
// Add multiple chapters with the detected pattern
|
||||
for (let i = 0; i < count; i++) {
|
||||
const chapterNumber = startingNumber + i
|
||||
const newStart = baseStart + i * defaultDuration
|
||||
const newEnd = Math.min(newStart + defaultDuration, this.mediaDuration)
|
||||
const newStart = baseStart + i
|
||||
const newEnd = Math.min(newStart + i + i, this.mediaDuration)
|
||||
|
||||
const newChapter = {
|
||||
id: this.newChapters.length,
|
||||
|
Loading…
Reference in New Issue
Block a user