From 777c59458dda17f4923d0d07829ac488e8e0db18 Mon Sep 17 00:00:00 2001 From: advplyr Date: Tue, 31 Dec 2024 17:11:31 -0600 Subject: [PATCH] Fix find all playlist endpoint --- server/controllers/PlaylistController.js | 4 ++-- server/models/PlaylistMediaItem.js | 9 --------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/server/controllers/PlaylistController.js b/server/controllers/PlaylistController.js index ee4fef5e..8c13ecb2 100644 --- a/server/controllers/PlaylistController.js +++ b/server/controllers/PlaylistController.js @@ -121,7 +121,7 @@ class PlaylistController { /** * @deprecated - Use /api/libraries/:libraryId/playlists * This is not used by Abs web client or mobile apps - * TODO: Remove this endpoint or refactor it and make it the primary + * TODO: Remove this endpoint or make it the primary * * GET: /api/playlists * Get all playlists for user @@ -130,7 +130,7 @@ class PlaylistController { * @param {Response} res */ async findAllForUser(req, res) { - const playlistsForUser = await Database.playlistModel.getOldPlaylistsForUserAndLibrary(req.user.id, req.params.libraryId) + const playlistsForUser = await Database.playlistModel.getOldPlaylistsForUserAndLibrary(req.user.id) res.json({ playlists: playlistsForUser }) diff --git a/server/models/PlaylistMediaItem.js b/server/models/PlaylistMediaItem.js index b9f76c5e..2eac036b 100644 --- a/server/models/PlaylistMediaItem.js +++ b/server/models/PlaylistMediaItem.js @@ -23,15 +23,6 @@ class PlaylistMediaItem extends Model { this.mediaItem } - static removeByIds(playlistId, mediaItemId) { - return this.destroy({ - where: { - playlistId, - mediaItemId - } - }) - } - getMediaItem(options) { if (!this.mediaItemType) return Promise.resolve(null) const mixinMethodName = `get${this.sequelize.uppercaseFirst(this.mediaItemType)}`