Add size stats

This commit is contained in:
mfcar 2023-02-19 21:39:28 +00:00
parent 911c854365
commit 08d7a9aa14
No known key found for this signature in database
4 changed files with 46 additions and 4 deletions

View file

@ -637,6 +637,7 @@ class LibraryController {
var authorsWithCount = libraryHelpers.getAuthorsWithCount(libraryItems)
var genresWithCount = libraryHelpers.getGenresWithCount(libraryItems)
var durationStats = libraryHelpers.getItemDurationStats(libraryItems)
var sizeStats = libraryHelpers.getItemSizeStats(libraryItems)
var stats = {
totalItems: libraryItems.length,
totalAuthors: Object.keys(authorsWithCount).length,
@ -645,6 +646,7 @@ class LibraryController {
longestItems: durationStats.longestItems,
numAudioTracks: durationStats.numAudioTracks,
totalSize: libraryHelpers.getLibraryItemsTotalSize(libraryItems),
largestItems: sizeStats.largestItems,
authorsWithCount,
genresWithCount
}
@ -755,4 +757,4 @@ class LibraryController {
next()
}
}
module.exports = new LibraryController()
module.exports = new LibraryController()