mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-16 04:14:58 +02:00
Adding download tab and download manager, ffmpeg in worker thread
This commit is contained in:
parent
a86bda59f6
commit
e4dac5dd05
28 changed files with 757 additions and 60 deletions
36
client/store/downloads.js
Normal file
36
client/store/downloads.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
|
||||
export const state = () => ({
|
||||
downloads: []
|
||||
})
|
||||
|
||||
export const getters = {
|
||||
getDownloads: (state) => (audiobookId) => {
|
||||
return state.downloads.filter(d => d.audiobookId === audiobookId)
|
||||
}
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
|
||||
}
|
||||
|
||||
export const mutations = {
|
||||
addUpdateDownload(state, download) {
|
||||
// Remove older downloads of matching type
|
||||
state.downloads = state.downloads.filter(d => {
|
||||
if (d.id !== download.id && d.type === download.type) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
var index = state.downloads.findIndex(d => d.id === download.id)
|
||||
if (index >= 0) {
|
||||
state.downloads.splice(index, 1, download)
|
||||
} else {
|
||||
state.downloads.push(download)
|
||||
}
|
||||
},
|
||||
removeDownload(state, download) {
|
||||
state.downloads = state.downloads.filter(d => d.id !== download.id)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue