mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-11-24 20:05:41 +01:00
Remove duplicate (and also wrong byte conversion)
This commit is contained in:
parent
9ce6de3100
commit
4224f44259
@ -143,19 +143,12 @@ export default {
|
|||||||
return Math.min(100, Math.round((this.uploadProgress.loaded / this.uploadProgress.total) * 100))
|
return Math.min(100, Math.round((this.uploadProgress.loaded / this.uploadProgress.total) * 100))
|
||||||
},
|
},
|
||||||
uploadProgressText() {
|
uploadProgressText() {
|
||||||
const loaded = this.formatBytes(this.uploadProgress.loaded)
|
const loaded = this.$bytesPretty(this.uploadProgress.loaded)
|
||||||
const total = this.formatBytes(this.uploadProgress.total)
|
const total = this.$bytesPretty(this.uploadProgress.total)
|
||||||
return `${this.uploadProgressPercent}% (${loaded} / ${total})`
|
return `${this.uploadProgressPercent}% (${loaded} / ${total})`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatBytes(bytes) {
|
|
||||||
if (bytes === 0) return '0 Bytes'
|
|
||||||
const k = 1024
|
|
||||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']
|
|
||||||
const i = Math.floor(Math.log(bytes) / Math.log(k))
|
|
||||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]
|
|
||||||
},
|
|
||||||
setUploadStatus(status) {
|
setUploadStatus(status) {
|
||||||
this.isUploading = status === 'uploading'
|
this.isUploading = status === 'uploading'
|
||||||
this.uploadFailed = status === 'failed'
|
this.uploadFailed = status === 'failed'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user