mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-16 04:14:58 +02:00
Update:Experimental metadata embed tool to use tone
This commit is contained in:
parent
b6e3559aba
commit
97da73baf3
10 changed files with 296 additions and 119 deletions
|
@ -80,7 +80,7 @@ function elapsedPretty(seconds) {
|
|||
}
|
||||
module.exports.elapsedPretty = elapsedPretty
|
||||
|
||||
function secondsToTimestamp(seconds, includeMs = false) {
|
||||
function secondsToTimestamp(seconds, includeMs = false, alwaysIncludeHours = false) {
|
||||
var _seconds = seconds
|
||||
var _minutes = Math.floor(seconds / 60)
|
||||
_seconds -= _minutes * 60
|
||||
|
@ -91,6 +91,9 @@ function secondsToTimestamp(seconds, includeMs = false) {
|
|||
_seconds = Math.floor(_seconds)
|
||||
|
||||
var msString = '.' + (includeMs ? ms.toFixed(3) : '0.0').split('.')[1]
|
||||
if (alwaysIncludeHours) {
|
||||
return `${_hours.toString().padStart(2, '0')}:${_minutes.toString().padStart(2, '0')}:${_seconds.toString().padStart(2, '0')}${msString}`
|
||||
}
|
||||
if (!_hours) {
|
||||
return `${_minutes}:${_seconds.toString().padStart(2, '0')}${msString}`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue