mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-16 16:31:30 +00:00
Update bulk download endpoint ensure items are from the same library requested
This commit is contained in:
parent
39adefb632
commit
b7e8a0474a
1 changed files with 6 additions and 1 deletions
|
|
@ -1435,10 +1435,15 @@ class LibraryController {
|
|||
const libraryItems = await Database.libraryItemModel.findAll({
|
||||
attributes: ['id', 'libraryId', 'path', 'isFile'],
|
||||
where: {
|
||||
id: itemIds
|
||||
id: itemIds,
|
||||
libraryId: req.library.id
|
||||
}
|
||||
})
|
||||
|
||||
if (libraryItems.length < itemIds.length) {
|
||||
Logger.warn(`[LibraryController] User "${req.user.username}" requested ${itemIds.length} items but only ${libraryItems.length} are in library "${req.library.id}"`)
|
||||
}
|
||||
|
||||
Logger.info(`[LibraryController] User "${req.user.username}" requested download for items "${itemIds}"`)
|
||||
|
||||
const filename = `LibraryItems-${Date.now()}.zip`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue