mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-09 17:04:58 +02:00
Update cover API endpoint to only load necessary data from DB #2073
This commit is contained in:
parent
f1cce76e2c
commit
5e976c08af
4 changed files with 53 additions and 15 deletions
|
@ -326,6 +326,18 @@ class User {
|
|||
return this.checkCanAccessLibraryItemWithTags(libraryItem.media.tags)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a user can access a library item
|
||||
* @param {string} libraryId
|
||||
* @param {boolean} explicit
|
||||
* @param {string[]} tags
|
||||
*/
|
||||
checkCanAccessLibraryItemWithData(libraryId, explicit, tags) {
|
||||
if (!this.checkCanAccessLibrary(libraryId)) return false
|
||||
if (explicit && !this.canAccessExplicitContent) return false
|
||||
return this.checkCanAccessLibraryItemWithTags(tags)
|
||||
}
|
||||
|
||||
findBookmark(libraryItemId, time) {
|
||||
return this.bookmarks.find(bm => bm.libraryItemId === libraryItemId && bm.time == time)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue