mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-12 10:25:02 +02:00
Add back in m4b merge downloader in experimental #478
This commit is contained in:
parent
f781fa9e6b
commit
ad3fbe7abf
12 changed files with 611 additions and 297 deletions
|
@ -4,8 +4,8 @@ export const state = () => ({
|
|||
})
|
||||
|
||||
export const getters = {
|
||||
getDownloads: (state) => (audiobookId) => {
|
||||
return state.downloads.filter(d => d.audiobookId === audiobookId)
|
||||
getDownloads: (state) => (libraryItemId) => {
|
||||
return state.downloads.filter(d => d.libraryItemId === libraryItemId)
|
||||
},
|
||||
getDownload: (state) => (id) => {
|
||||
return state.downloads.find(d => d.id === id)
|
||||
|
@ -17,15 +17,10 @@ export const actions = {
|
|||
}
|
||||
|
||||
export const mutations = {
|
||||
setDownloads(state, downloads) {
|
||||
state.downloads = downloads
|
||||
},
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue