mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-04-19 04:05:55 -04:00
Merge pull request #4164 from advplyr/count_cache_for_userpermissions
Fix items count for users with item restricting permissions
This commit is contained in:
commit
7f3421f78a
2 changed files with 2 additions and 2 deletions
|
@ -601,7 +601,7 @@ module.exports = {
|
|||
}
|
||||
|
||||
const findAndCountAll = process.env.QUERY_PROFILING ? profile(this.findAndCountAll) : this.findAndCountAll
|
||||
const { rows: books, count } = await findAndCountAll(findOptions, limit, offset, !filterGroup)
|
||||
const { rows: books, count } = await findAndCountAll(findOptions, limit, offset, !filterGroup && !userPermissionBookWhere.bookWhere.length)
|
||||
|
||||
const libraryItems = books.map((bookExpanded) => {
|
||||
const libraryItem = bookExpanded.libraryItem
|
||||
|
|
|
@ -204,7 +204,7 @@ module.exports = {
|
|||
|
||||
const findAndCountAll = process.env.QUERY_PROFILING ? profile(this.findAndCountAll) : this.findAndCountAll
|
||||
|
||||
const { rows: podcasts, count } = await findAndCountAll(findOptions, Database.podcastModel, limit, offset, !filterGroup)
|
||||
const { rows: podcasts, count } = await findAndCountAll(findOptions, Database.podcastModel, limit, offset, !filterGroup && !userPermissionPodcastWhere.podcastWhere.length)
|
||||
|
||||
const libraryItems = podcasts.map((podcastExpanded) => {
|
||||
const libraryItem = podcastExpanded.libraryItem
|
||||
|
|
Loading…
Add table
Reference in a new issue