mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-23 17:29:19 +02:00
Add: button on issues page to remove all library items with issues #476
This commit is contained in:
parent
4bc7cd2045
commit
2e28c9b06d
4 changed files with 50 additions and 1 deletions
|
@ -226,6 +226,22 @@ class LibraryController {
|
|||
res.json(payload)
|
||||
}
|
||||
|
||||
async removeLibraryItemsWithIssues(req, res) {
|
||||
var libraryItemsWithIssues = req.libraryItems.filter(li => li.hasIssues)
|
||||
if (!libraryItemsWithIssues.length) {
|
||||
Logger.warn(`[LibraryController] No library items have issues`)
|
||||
return res.sendStatus(200)
|
||||
}
|
||||
|
||||
Logger.info(`[LibraryController] Removing ${libraryItemsWithIssues.length} items with issues`)
|
||||
for (const libraryItem of libraryItemsWithIssues) {
|
||||
Logger.info(`[LibraryController] Removing library item "${libraryItem.media.metadata.title}"`)
|
||||
await this.handleDeleteLibraryItem(libraryItem)
|
||||
}
|
||||
|
||||
res.sendStatus(200)
|
||||
}
|
||||
|
||||
// api/libraries/:id/series
|
||||
async getAllSeriesForLibrary(req, res) {
|
||||
var libraryItems = req.libraryItems
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue