mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-29 14:28:34 +02:00
Check app version, fix close stream bug, show audiobook progress, add toasts
This commit is contained in:
parent
98076927ff
commit
619b6f3686
51 changed files with 551 additions and 141 deletions
|
@ -1,17 +1,6 @@
|
|||
import Vue from 'vue'
|
||||
Vue.prototype.$isDev = process.env.NODE_ENV !== 'production'
|
||||
|
||||
import { Toast } from '@capacitor/toast'
|
||||
|
||||
Vue.prototype.$toast = (text) => {
|
||||
if (!Toast) {
|
||||
return console.error('No Toast Plugin')
|
||||
}
|
||||
Toast.show({
|
||||
text: text
|
||||
})
|
||||
}
|
||||
|
||||
Vue.prototype.$bytesPretty = (bytes, decimals = 2) => {
|
||||
if (bytes === 0) {
|
||||
return '0 Bytes'
|
||||
|
@ -23,6 +12,19 @@ Vue.prototype.$bytesPretty = (bytes, decimals = 2) => {
|
|||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]
|
||||
}
|
||||
|
||||
Vue.prototype.$elapsedPretty = (seconds) => {
|
||||
var minutes = Math.floor(seconds / 60)
|
||||
if (minutes < 70) {
|
||||
return `${minutes} min`
|
||||
}
|
||||
var hours = Math.floor(minutes / 60)
|
||||
minutes -= hours * 60
|
||||
if (!minutes) {
|
||||
return `${hours} hr`
|
||||
}
|
||||
return `${hours} hr ${minutes} min`
|
||||
}
|
||||
|
||||
Vue.prototype.$secondsToTimestamp = (seconds) => {
|
||||
var _seconds = seconds
|
||||
var _minutes = Math.floor(seconds / 60)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue