mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-03 05:34:23 +01:00
Update playlist API endpoints to load library items from DB
This commit is contained in:
1 parent
6056c14926
commit
fc44c801f2
5 files changed
+358
-205
No files matched your search
@@ -122,9 +122,13 @@ class UserController {
|
||||
// Todo: check if user is logged in and cancel streams
|
||||
|
||||
// Remove user playlists
|
||||
const userPlaylists = await Database.models.playlist.getPlaylistsForUserAndLibrary(user.id)
|
||||
const userPlaylists = await Database.models.playlist.findAll({
|
||||
where: {
|
||||
userId: user.id
|
||||
}
|
||||
})
|
||||
for (const playlist of userPlaylists) {
|
||||
await Database.removePlaylist(playlist.id)
|
||||
await playlist.destroy()
|
||||
}
|
||||
|
||||
const userJson = user.toJSONForBrowser()
|
||||
|
||||
Reference in new issue
Block a user