mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-27 17:00:34 -04:00
Fix library stats returning null instead of 0 #4251
This commit is contained in:
parent
1a1ef9c378
commit
45987ffd63
2 changed files with 10 additions and 3 deletions
|
@ -1247,7 +1247,12 @@ module.exports = {
|
||||||
libraryId
|
libraryId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return statResults[0]
|
return {
|
||||||
|
totalSize: statResults?.[0]?.totalSize || 0,
|
||||||
|
totalDuration: statResults?.[0]?.totalDuration || 0,
|
||||||
|
numAudioFiles: statResults?.[0]?.numAudioFiles || 0,
|
||||||
|
totalItems: statResults?.[0]?.totalItems || 0
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -533,8 +533,10 @@ module.exports = {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
...statResults[0],
|
totalDuration: statResults?.[0]?.totalDuration || 0,
|
||||||
totalSize: sizeResults[0].totalSize || 0
|
numAudioFiles: statResults?.[0]?.numAudioFiles || 0,
|
||||||
|
totalItems: statResults?.[0]?.totalItems || 0,
|
||||||
|
totalSize: sizeResults?.[0]?.totalSize || 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue