mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-27 00:59:14 +01:00
Fix byte conversion
This commit is contained in:
parent
24b9ac6a68
commit
38596d017f
@ -83,7 +83,7 @@ function bytesPretty(bytes, decimals = 0) {
|
||||
if (bytes === 0) {
|
||||
return '0 Bytes'
|
||||
}
|
||||
const k = 1024
|
||||
const k = 1000
|
||||
var dm = decimals < 0 ? 0 : decimals
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k))
|
||||
@ -265,4 +265,4 @@ module.exports.removeFile = (path) => {
|
||||
|
||||
module.exports.encodeUriPath = (path) => {
|
||||
return filePathToPOSIX(path).replace(/%/g, '%25').replace(/#/g, '%23')
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user