mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Fix req.query check and response
This commit is contained in:
		
							parent
							
								
									3c9966e849
								
							
						
					
					
						commit
						1def32aa50
					
				| @ -1424,7 +1424,7 @@ class LibraryController { | ||||
|    * GET: /api/library/:id/download | ||||
|    * Downloads multiple library items | ||||
|    * | ||||
|    * @param {LibraryItemControllerRequest} req | ||||
|    * @param {LibraryControllerRequest} req | ||||
|    * @param {Response} res | ||||
|    */ | ||||
|   async downloadMultiple(req, res) { | ||||
| @ -1433,8 +1433,9 @@ class LibraryController { | ||||
|       return res.sendStatus(403) | ||||
|     } | ||||
| 
 | ||||
|     if(req.query.ids === undefined || req.query.ids === '') { | ||||
|       res.status(400).send('Library items not found') | ||||
|     if (!req.query.ids || typeof req.query.ids !== 'string') { | ||||
|       res.status(400).send('Invalid request. ids must be a string') | ||||
|       return | ||||
|     } | ||||
| 
 | ||||
|     const itemIds = req.query.ids.split(',') | ||||
| @ -1467,7 +1468,6 @@ class LibraryController { | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   /** | ||||
|    * | ||||
|    * @param {RequestWithUser} req | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user