mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-10 19:31:39 +00:00
Update: cover modal toasts
This commit is contained in:
parent
10c93ed9c6
commit
74b0d145ac
4 changed files with 18 additions and 13 deletions
|
|
@ -78,14 +78,14 @@ export default {
|
|||
if (data.error) {
|
||||
this.$toast.error(data.error)
|
||||
} else {
|
||||
this.$toast.success('Cover Uploaded')
|
||||
this.$toast.success(this.$strings.ToastCoverUploaded)
|
||||
this.resetCoverPreview()
|
||||
}
|
||||
this.processingUpload = false
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed', error)
|
||||
var errorMsg = error.response && error.response.data ? error.response.data : 'Unknown Error'
|
||||
var errorMsg = error.response && error.response.data ? error.response.data : this.$strings.ToastUnknownError
|
||||
this.$toast.error(errorMsg)
|
||||
this.processingUpload = false
|
||||
})
|
||||
|
|
@ -95,7 +95,7 @@ export default {
|
|||
|
||||
var success = await this.$axios.$post(`/api/${this.entity}/${this.entityId}/cover`, { url: this.imageUrl }).catch((error) => {
|
||||
console.error('Failed to download cover from url', error)
|
||||
var errorMsg = error.response && error.response.data ? error.response.data : 'Unknown Error'
|
||||
var errorMsg = error.response && error.response.data ? error.response.data : this.$strings.ToastUnknownError
|
||||
this.$toast.error(errorMsg)
|
||||
return false
|
||||
})
|
||||
|
|
@ -104,4 +104,4 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ export default {
|
|||
if (data.error) {
|
||||
this.$toast.error(data.error)
|
||||
} else {
|
||||
this.$toast.success('Cover Uploaded')
|
||||
this.$toast.success(this.$strings.ToastCoverUploaded)
|
||||
this.resetCoverPreview()
|
||||
}
|
||||
this.processingUpload = false
|
||||
|
|
@ -204,7 +204,7 @@ export default {
|
|||
if (error.response && error.response.data) {
|
||||
this.$toast.error(error.response.data)
|
||||
} else {
|
||||
this.$toast.error('Oops, something went wrong...')
|
||||
this.$toast.error(this.$strings.ToastUnknownError)
|
||||
}
|
||||
this.processingUpload = false
|
||||
})
|
||||
|
|
@ -255,7 +255,7 @@ export default {
|
|||
},
|
||||
async updateCover(cover) {
|
||||
if (!cover.startsWith('http:') && !cover.startsWith('https:')) {
|
||||
this.$toast.error('Invalid URL')
|
||||
this.$toast.error(this.$strings.ToastInvalidUrl)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -264,11 +264,11 @@ export default {
|
|||
.$post(`/api/items/${this.libraryItemId}/cover`, { url: cover })
|
||||
.then(() => {
|
||||
this.imageUrl = ''
|
||||
this.$toast.success('Update Successful')
|
||||
this.$toast.success(this.$strings.ToastCoverUpdateSuccess)
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to update cover', error)
|
||||
this.$toast.error(error.response?.data || 'Failed to update cover')
|
||||
this.$toast.error(error.response?.data || this.$strings.ToastCoverUpdateFailed)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isProcessing = false
|
||||
|
|
@ -309,11 +309,11 @@ export default {
|
|||
this.$axios
|
||||
.$patch(`/api/items/${this.libraryItemId}/cover`, { cover: coverFile.metadata.path })
|
||||
.then(() => {
|
||||
this.$toast.success('Update Successful')
|
||||
this.$toast.success(this.$strings.ToastCoverUpdateSuccess)
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to set local cover', error)
|
||||
this.$toast.error(error.response?.data || 'Failed to set cover')
|
||||
this.$toast.error(error.response?.data || this.$strings.ToastCoverUpdateFailed)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isProcessing = false
|
||||
|
|
@ -321,4 +321,4 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ export default {
|
|||
this.isProcessing = false
|
||||
if (updateResult) {
|
||||
if (updateResult.updated) {
|
||||
this.$toast.success('Item details updated')
|
||||
this.$toast.success(this.$strings.ToastItemDetailsUpdateSuccess)
|
||||
return true
|
||||
} else {
|
||||
this.$toast.info(this.$strings.MessageNoUpdatesWereNecessary)
|
||||
|
|
|
|||
|
|
@ -845,6 +845,9 @@
|
|||
"ToastCollectionRemoveSuccess": "Collection removed",
|
||||
"ToastCollectionUpdateFailed": "Failed to update collection",
|
||||
"ToastCollectionUpdateSuccess": "Collection updated",
|
||||
"ToastCoverUpdateFailed": "Cover update failed",
|
||||
"ToastCoverUpdateSuccess": "Cover updated",
|
||||
"ToastCoverUploaded": "Cover uploaded",
|
||||
"ToastDeleteFileFailed": "Failed to delete file",
|
||||
"ToastDeleteFileSuccess": "File deleted",
|
||||
"ToastDeviceAddFailed": "Failed to add device",
|
||||
|
|
@ -860,6 +863,7 @@
|
|||
"ToastFailedToUpdateUser": "Failed to update user",
|
||||
"ToastFfprobeFailed": "FFprobe failed",
|
||||
"ToastInvalidImageUrl": "Invalid image URL",
|
||||
"ToastInvalidUrl": "Invalid URL",
|
||||
"ToastItemCoverUpdateFailed": "Failed to update item cover",
|
||||
"ToastItemCoverUpdateSuccess": "Item cover updated",
|
||||
"ToastItemDeletedFailed": "Failed to delete item",
|
||||
|
|
@ -930,6 +934,7 @@
|
|||
"ToastSortingPrefixesUpdateFailed": "Failed to update sorting prefixes",
|
||||
"ToastSortingPrefixesUpdateSuccess": "Sorting prefixes updated ({0} items)",
|
||||
"ToastTitleRequired": "Title is required",
|
||||
"ToastUnknownError": "Unknown error",
|
||||
"ToastUnlinkOpenIdFailed": "Failed to unlink user from OpenID",
|
||||
"ToastUnlinkOpenIdSuccess": "User unlinked from OpenID",
|
||||
"ToastUserDeleteFailed": "Failed to delete user",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue