mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-11-04 03:17:00 -05:00 
			
		
		
		
	Fix:Merging chapters from multiple files skipping chapters #857
This commit is contained in:
		
							parent
							
								
									8416f2d6be
								
							
						
					
					
						commit
						21e1f62c65
					
				@ -420,10 +420,10 @@ class Book {
 | 
				
			|||||||
        // If audio file has chapters use chapters
 | 
					        // If audio file has chapters use chapters
 | 
				
			||||||
        if (file.chapters && file.chapters.length) {
 | 
					        if (file.chapters && file.chapters.length) {
 | 
				
			||||||
          file.chapters.forEach((chapter) => {
 | 
					          file.chapters.forEach((chapter) => {
 | 
				
			||||||
            if (chapter.start > this.duration) {
 | 
					            if (currStartTime > this.duration) {
 | 
				
			||||||
              Logger.warn(`[Book] Invalid chapter start time > duration`)
 | 
					              Logger.warn(`[Book] Invalid chapter start time > duration`)
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
              var chapterAlreadyExists = this.chapters.find(ch => ch.start === chapter.start)
 | 
					              var chapterAlreadyExists = this.chapters.find(ch => ch.start === currStartTime)
 | 
				
			||||||
              if (!chapterAlreadyExists) {
 | 
					              if (!chapterAlreadyExists) {
 | 
				
			||||||
                var chapterDuration = chapter.end - chapter.start
 | 
					                var chapterDuration = chapter.end - chapter.start
 | 
				
			||||||
                if (chapterDuration > 0) {
 | 
					                if (chapterDuration > 0) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user