mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-21 10:51:30 +00:00
Merge branch 'advplyr:master' into #4584-sort-options-for-narrators
This commit is contained in:
commit
60624ecff2
64 changed files with 2679 additions and 315 deletions
|
|
@ -126,7 +126,7 @@
|
|||
<ui-tooltip v-if="selectedChapterId === chapter.id && (isPlayingChapter || isLoadingChapter)" :text="$strings.TooltipAdjustChapterStart" direction="bottom">
|
||||
<div class="ml-2 text-xs text-gray-300 font-mono min-w-10 cursor-pointer hover:text-white transition-colors duration-150" @click="adjustChapterStartTime(chapter)">{{ elapsedTime }}s</div>
|
||||
</ui-tooltip>
|
||||
<ui-tooltip v-if="chapter.error" :text="chapter.error" direction="left">
|
||||
<ui-tooltip v-if="chapter.error" :text="chapter.error" plaintext direction="left">
|
||||
<button class="w-7 h-7 rounded-full flex items-center justify-center text-error">
|
||||
<span class="material-symbols text-lg">error_outline</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -297,6 +297,15 @@ export default {
|
|||
ref.setUploadStatus(status)
|
||||
}
|
||||
},
|
||||
updateItemCardProgress(index, progress) {
|
||||
var ref = this.$refs[`itemCard-${index}`]
|
||||
if (ref && ref.length) ref = ref[0]
|
||||
if (!ref) {
|
||||
console.error('Book card ref not found', index, this.$refs)
|
||||
} else {
|
||||
ref.setUploadProgress(progress)
|
||||
}
|
||||
},
|
||||
async uploadItem(item) {
|
||||
var form = new FormData()
|
||||
form.set('title', item.title)
|
||||
|
|
@ -312,8 +321,20 @@ export default {
|
|||
form.set(`${index++}`, file)
|
||||
})
|
||||
|
||||
const config = {
|
||||
onUploadProgress: (progressEvent) => {
|
||||
if (progressEvent.lengthComputable) {
|
||||
const progress = {
|
||||
loaded: progressEvent.loaded,
|
||||
total: progressEvent.total
|
||||
}
|
||||
this.updateItemCardProgress(item.index, progress)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.$axios
|
||||
.$post('/api/upload', form)
|
||||
.$post('/api/upload', form, config)
|
||||
.then(() => true)
|
||||
.catch((error) => {
|
||||
console.error('Failed to upload item', error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue