Merge branch 'advplyr:master' into #4584-sort-options-for-narrators

This commit is contained in:
S-Reinhard 2026-03-06 17:15:49 +01:00 committed by GitHub
commit 60624ecff2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
64 changed files with 2679 additions and 315 deletions

View file

@ -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>

View file

@ -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)