mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-19 00:18:56 +01:00
Fix:Server crash when removing last item from a playlist #2211
This commit is contained in:
parent
e687a3403e
commit
3108bc5ccc
@ -286,7 +286,7 @@ class PodcastController {
|
|||||||
const numItems = pmi.playlist.playlistMediaItems.length - 1
|
const numItems = pmi.playlist.playlistMediaItems.length - 1
|
||||||
|
|
||||||
if (!numItems) {
|
if (!numItems) {
|
||||||
Logger.info(`[PodcastController] Playlist "${playlist.name}" has no more items - removing it`)
|
Logger.info(`[PodcastController] Playlist "${pmi.playlist.name}" has no more items - removing it`)
|
||||||
const jsonExpanded = await pmi.playlist.getOldJsonExpanded()
|
const jsonExpanded = await pmi.playlist.getOldJsonExpanded()
|
||||||
SocketAuthority.clientEmitter(pmi.playlist.userId, 'playlist_removed', jsonExpanded)
|
SocketAuthority.clientEmitter(pmi.playlist.userId, 'playlist_removed', jsonExpanded)
|
||||||
await pmi.playlist.destroy()
|
await pmi.playlist.destroy()
|
||||||
|
Loading…
Reference in New Issue
Block a user