audiobookshelf/server/utils/queries/libraryBrowseCount.js
2026-03-14 02:04:10 -04:00

21 lines
350 B
JavaScript

async function loadBrowseCount({ mode, exactCountLoader } = {}) {
if (mode === 'skip') {
return {
total: null,
isExact: false,
isDeferred: true
}
}
const total = await exactCountLoader()
return {
total,
isExact: true,
isDeferred: mode === 'deferred-exact'
}
}
module.exports = {
loadBrowseCount
}