mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-21 19:34:43 +02:00
Update cover url, audiobook player speed
This commit is contained in:
parent
8fbdc1523d
commit
dee7bcb2c2
6 changed files with 58 additions and 19 deletions
|
@ -1,10 +1,14 @@
|
|||
<template>
|
||||
<div class="w-full h-full">
|
||||
<!-- <img :src="cover" class="w-40 h-60" /> -->
|
||||
<div class="flex">
|
||||
<cards-book-cover :audiobook="audiobook" />
|
||||
<div class="flex-grow px-8">
|
||||
<ui-text-input-with-label v-model="imageUrl" label="Image URL" />
|
||||
<form @submit.prevent="submitForm">
|
||||
<div class="flex items-center">
|
||||
<ui-text-input-with-label v-model="imageUrl" label="Cover Image URL" />
|
||||
<ui-btn color="success" type="submit" :padding-x="4" class="mt-5 ml-4">Update</ui-btn>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -13,6 +17,7 @@
|
|||
<script>
|
||||
export default {
|
||||
props: {
|
||||
processing: Boolean,
|
||||
audiobook: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
|
@ -20,7 +25,6 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
cover: null,
|
||||
imageUrl: null
|
||||
}
|
||||
},
|
||||
|
@ -32,10 +36,41 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
computed: {
|
||||
isProcessing: {
|
||||
get() {
|
||||
return this.processing
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:processing', val)
|
||||
}
|
||||
},
|
||||
book() {
|
||||
return this.audiobook ? this.audiobook.book || {} : {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.cover = this.audiobook.cover || '/book_placeholder.jpg'
|
||||
this.imageUrl = this.book.cover || ''
|
||||
},
|
||||
async submitForm() {
|
||||
console.log('Submit form', this.details)
|
||||
this.isProcessing = true
|
||||
const updatePayload = {
|
||||
book: {
|
||||
cover: this.imageUrl
|
||||
}
|
||||
}
|
||||
var updatedAudiobook = await this.$axios.$patch(`/api/audiobook/${this.audiobook.id}`, updatePayload).catch((error) => {
|
||||
console.error('Failed to update', error)
|
||||
return false
|
||||
})
|
||||
this.isProcessing = false
|
||||
if (updatedAudiobook) {
|
||||
console.log('Update Successful', updatedAudiobook)
|
||||
this.$toast.success('Update Successful')
|
||||
this.$emit('close')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue