Add: User listening sessions and user listening stats #167

This commit is contained in:
advplyr 2021-11-12 19:43:16 -06:00
parent 663d02e9fe
commit 91e44bc2f9
16 changed files with 461 additions and 72 deletions

View file

@ -54,6 +54,22 @@ Vue.prototype.$secondsToTimestamp = (seconds) => {
return `${_hours}:${_minutes.toString().padStart(2, '0')}:${_seconds.toString().padStart(2, '0')}`
}
Vue.prototype.$elapsedPrettyExtended = (seconds) => {
var minutes = Math.floor(seconds / 60)
seconds -= minutes * 60
var hours = Math.floor(minutes / 60)
minutes -= hours * 60
var days = Math.floor(hours / 24)
hours -= days * 24
var strs = []
if (days) strs.push(`${days}d`)
if (hours) strs.push(`${hours}h`)
if (minutes) strs.push(`${minutes}m`)
if (seconds) strs.push(`${seconds}s`)
return strs.join(' ')
}
Vue.prototype.$calculateTextSize = (text, styles = {}) => {
const el = document.createElement('p')