mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-05-13 01:19:55 +02:00
Fix library stats returning null instead of 0 #4251
This commit is contained in:
parent
1a1ef9c378
commit
45987ffd63
@ -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…
Reference in New Issue
Block a user