Update:Only load collections when needed

This commit is contained in:
advplyr 2023-07-22 16:18:55 -05:00
parent 354e16e462
commit 5a9eed0a5a
8 changed files with 87 additions and 24 deletions

View file

@ -200,7 +200,7 @@ class PlaylistController {
// POST: api/playlists/collection/:collectionId
async createFromCollection(req, res) {
let collection = Database.collections.find(c => c.id === req.params.collectionId)
let collection = await Database.models.collection.getById(req.params.collectionId)
if (!collection) {
return res.status(404).send('Collection not found')
}