diff --git a/server/controllers/LibraryController.js b/server/controllers/LibraryController.js index d63e834b..33e822c8 100644 --- a/server/controllers/LibraryController.js +++ b/server/controllers/LibraryController.js @@ -584,32 +584,6 @@ class LibraryController { res.json(payload) } - // api/libraries/:id/albums - async getAlbumsForLibrary(req, res) { - if (!req.library.isMusic) { - return res.status(400).send('Invalid library media type') - } - - let libraryItems = Database.libraryItems.filter(li => li.libraryId === req.library.id) - let albums = libraryHelpers.groupMusicLibraryItemsIntoAlbums(libraryItems) - albums = naturalSort(albums).asc(a => a.title) // Alphabetical by album title - - const payload = { - results: [], - total: albums.length, - limit: req.query.limit && !isNaN(req.query.limit) ? Number(req.query.limit) : 0, - page: req.query.page && !isNaN(req.query.page) ? Number(req.query.page) : 0 - } - - if (payload.limit) { - const startIndex = payload.page * payload.limit - albums = albums.slice(startIndex, startIndex + payload.limit) - } - - payload.results = albums - res.json(payload) - } - async getLibraryFilterData(req, res) { res.json(libraryHelpers.getDistinctFilterDataNew(req.libraryItems)) } diff --git a/server/routers/ApiRouter.js b/server/routers/ApiRouter.js index a8dfad13..80615e10 100644 --- a/server/routers/ApiRouter.js +++ b/server/routers/ApiRouter.js @@ -82,7 +82,6 @@ class ApiRouter { this.router.get('/libraries/:id/series/:seriesId', LibraryController.middleware.bind(this), LibraryController.getSeriesForLibrary.bind(this)) this.router.get('/libraries/:id/collections', LibraryController.middlewareNew.bind(this), LibraryController.getCollectionsForLibrary.bind(this)) this.router.get('/libraries/:id/playlists', LibraryController.middleware.bind(this), LibraryController.getUserPlaylistsForLibrary.bind(this)) - this.router.get('/libraries/:id/albums', LibraryController.middleware.bind(this), LibraryController.getAlbumsForLibrary.bind(this)) this.router.get('/libraries/:id/personalized2', LibraryController.middlewareNew.bind(this), LibraryController.getUserPersonalizedShelves.bind(this)) this.router.get('/libraries/:id/personalized', LibraryController.middleware.bind(this), LibraryController.getLibraryUserPersonalizedOptimal.bind(this)) this.router.get('/libraries/:id/filterdata', LibraryController.middleware.bind(this), LibraryController.getLibraryFilterData.bind(this))