mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-02 13:34:53 +02:00
Add:Batch embed metadata and queue system for metadata embedding #700
This commit is contained in:
parent
1a3f0e332e
commit
034b8956a2
11 changed files with 402 additions and 209 deletions
|
@ -278,6 +278,13 @@ export default {
|
|||
console.log('Task finished', task)
|
||||
this.$store.commit('tasks/addUpdateTask', task)
|
||||
},
|
||||
metadataEmbedQueueUpdate(data) {
|
||||
if (data.queued) {
|
||||
this.$store.commit('tasks/addQueuedEmbedLId', data.libraryItemId)
|
||||
} else {
|
||||
this.$store.commit('tasks/removeQueuedEmbedLId', data.libraryItemId)
|
||||
}
|
||||
},
|
||||
userUpdated(user) {
|
||||
if (this.$store.state.user.user.id === user.id) {
|
||||
this.$store.commit('user/setUser', user)
|
||||
|
@ -418,6 +425,7 @@ export default {
|
|||
// Task Listeners
|
||||
this.socket.on('task_started', this.taskStarted)
|
||||
this.socket.on('task_finished', this.taskFinished)
|
||||
this.socket.on('metadata_embed_queue_update', this.metadataEmbedQueueUpdate)
|
||||
|
||||
this.socket.on('backup_applied', this.backupApplied)
|
||||
|
||||
|
@ -531,12 +539,18 @@ export default {
|
|||
},
|
||||
loadTasks() {
|
||||
this.$axios
|
||||
.$get('/api/tasks')
|
||||
.$get('/api/tasks?include=queue')
|
||||
.then((payload) => {
|
||||
console.log('Fetched tasks', payload)
|
||||
if (payload.tasks) {
|
||||
this.$store.commit('tasks/setTasks', payload.tasks)
|
||||
}
|
||||
if (payload.queuedTaskData?.embedMetadata?.length) {
|
||||
this.$store.commit(
|
||||
'tasks/setQueuedEmbedLIds',
|
||||
payload.queuedTaskData.embedMetadata.map((td) => td.libraryItemId)
|
||||
)
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to load tasks', error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue