mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Fix:Server crash when removing item from playlist #2115
This commit is contained in:
		
							parent
							
								
									fea28351f9
								
							
						
					
					
						commit
						cfd9a01da7
					
				| @ -206,7 +206,7 @@ class PlaylistController { | ||||
| 
 | ||||
|     await Database.createPlaylistMediaItem(playlistMediaItem) | ||||
|     const jsonExpanded = await req.playlist.getOldJsonExpanded() | ||||
|     SocketAuthority.clientEmitter(playlist.userId, 'playlist_updated', jsonExpanded) | ||||
|     SocketAuthority.clientEmitter(jsonExpanded.userId, 'playlist_updated', jsonExpanded) | ||||
|     res.json(jsonExpanded) | ||||
|   } | ||||
| 
 | ||||
| @ -376,9 +376,9 @@ class PlaylistController { | ||||
|       if (!numMediaItems) { | ||||
|         Logger.info(`[PlaylistController] Playlist "${req.playlist.name}" has no more items - removing it`) | ||||
|         await req.playlist.destroy() | ||||
|         SocketAuthority.clientEmitter(playlist.userId, 'playlist_removed', jsonExpanded) | ||||
|         SocketAuthority.clientEmitter(jsonExpanded.userId, 'playlist_removed', jsonExpanded) | ||||
|       } else { | ||||
|         SocketAuthority.clientEmitter(playlist.userId, 'playlist_updated', jsonExpanded) | ||||
|         SocketAuthority.clientEmitter(jsonExpanded.userId, 'playlist_updated', jsonExpanded) | ||||
|       } | ||||
|     } | ||||
|     res.json(jsonExpanded) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user