mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-15 13:51:35 +00:00
Added bitrate column to management tools
This commit is contained in:
parent
9a2b93fb37
commit
038ad7018a
2 changed files with 20 additions and 5 deletions
|
|
@ -15,6 +15,17 @@ Vue.prototype.$bytesPretty = (bytes, decimals = 2) => {
|
|||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]
|
||||
}
|
||||
|
||||
Vue.prototype.$bitratePretty = (bitrate, decimals = 1) => {
|
||||
if (isNaN(bitrate) || bitrate == 0) {
|
||||
return '0'
|
||||
}
|
||||
const k = 1000
|
||||
const dm = decimals < 0 ? 0 : decimals
|
||||
const sizes = ['', 'k', 'm']
|
||||
const i = Math.floor(Math.log(bitrate) / Math.log(k))
|
||||
return parseFloat((bitrate / Math.pow(k, i)).toFixed(dm)) + sizes[i]
|
||||
}
|
||||
|
||||
Vue.prototype.$elapsedPretty = (seconds, useFullNames = false) => {
|
||||
if (seconds < 60) {
|
||||
return `${Math.floor(seconds)} sec${useFullNames ? 'onds' : ''}`
|
||||
|
|
@ -146,7 +157,7 @@ Vue.prototype.$parseCronExpression = (expression) => {
|
|||
}
|
||||
|
||||
Vue.prototype.$getNextScheduledDate = (expression) => {
|
||||
const interval = cronParser.parseExpression(expression);
|
||||
const interval = cronParser.parseExpression(expression)
|
||||
return interval.next().toDate()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue