mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 07:23:34 +01:00
fix(webui): series cover uploads (#729)
This commit is contained in:
parent
9199407644
commit
32f4d7f651
2 changed files with 9 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<label class="drop-zone" v-cloak @drop.prevent="dropHandler" @dragover.prevent>
|
||||
<span class="file-input">Choose an image</span> - drag and drop
|
||||
<input hidden aria-hidden="true" type="file" accept="image/*" multiple @change="dropHandler" >
|
||||
<input ref="input" hidden aria-hidden="true" type="file" accept="image/*" multiple @change="dropHandler">
|
||||
</label>
|
||||
</template>
|
||||
|
||||
|
|
@ -25,6 +25,9 @@ export default Vue.extend({
|
|||
this.$emit('on-input-change', Array.from(selectedFiles))
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
(this.$refs.input as HTMLInputElement).value = ''
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@
|
|||
<!-- Upload -->
|
||||
<v-row>
|
||||
<v-col class="pa-1">
|
||||
<drop-zone @on-input-change="addThumbnail" class="pa-8"/>
|
||||
<drop-zone ref="thumbnailsUpload" @on-input-change="addThumbnail" class="pa-8"/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
|
@ -665,7 +665,7 @@ export default Vue.extend({
|
|||
if (this.single && this.poster.uploadQueue.length > 0) {
|
||||
const series = this.series as SeriesDto
|
||||
let hadErrors = false
|
||||
for (const file of this.poster.uploadQueue) {
|
||||
for (const file of this.poster.uploadQueue.slice()) {
|
||||
try {
|
||||
await this.$komgaSeries.uploadThumbnail(series.id, file, file.name === this.poster.selectedThumbnail)
|
||||
this.deleteThumbnail(file)
|
||||
|
|
@ -716,6 +716,8 @@ export default Vue.extend({
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
(this.$refs.thumbnailsUpload as any).reset()
|
||||
},
|
||||
async getThumbnails(series: SeriesDto | SeriesDto[]) {
|
||||
if (Array.isArray(series)) return
|
||||
|
|
@ -752,7 +754,7 @@ export default Vue.extend({
|
|||
this.poster.uploadQueue.splice(index, 1)
|
||||
}
|
||||
if (item.name === this.poster.selectedThumbnail) {
|
||||
this.selectThumbnail(this.poster.seriesThumbnails.find(x => x.selected))
|
||||
this.poster.selectedThumbnail = ''
|
||||
}
|
||||
} else {
|
||||
// if thumbnail was marked for deletion, unmark it
|
||||
|
|
|
|||
Loading…
Reference in a new issue