mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Fix:Mark as not finished when duration is not set in media progress #771
This commit is contained in:
		
							parent
							
								
									59c5e2c1d9
								
							
						
					
					
						commit
						76d668514e
					
				| @ -57,6 +57,7 @@ class MeController { | ||||
|     if (!libraryItem) { | ||||
|       return res.status(404).send('Item not found') | ||||
|     } | ||||
| 
 | ||||
|     var wasUpdated = req.user.createUpdateMediaProgress(libraryItem, req.body) | ||||
|     if (wasUpdated) { | ||||
|       await this.db.updateEntity('user', req.user) | ||||
|  | ||||
| @ -91,7 +91,7 @@ class MediaProgress { | ||||
| 
 | ||||
|     var timeRemaining = this.duration - this.currentTime | ||||
|     // If time remaining is less than 5 seconds then mark as finished
 | ||||
|     if ((this.progress >= 1 || (!isNaN(timeRemaining) && timeRemaining < 5))) { | ||||
|     if ((this.progress >= 1 || (this.duration && !isNaN(timeRemaining) && timeRemaining < 5))) { | ||||
|       this.isFinished = true | ||||
|       this.finishedAt = Date.now() | ||||
|       this.progress = 1 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user