mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-06 21:05:24 +02:00
Add: Experimental collections edit, book list, collection cover #151
This commit is contained in:
+10
-1
@@ -1,6 +1,8 @@
|
||||
|
||||
export const state = () => ({
|
||||
showUserCollectionsModal: false
|
||||
showUserCollectionsModal: false,
|
||||
showEditCollectionModal: false,
|
||||
selectedCollection: null
|
||||
})
|
||||
|
||||
export const getters = {
|
||||
@@ -14,5 +16,12 @@ export const actions = {
|
||||
export const mutations = {
|
||||
setShowUserCollectionsModal(state, val) {
|
||||
state.showUserCollectionsModal = val
|
||||
},
|
||||
setShowEditCollectionModal(state, val) {
|
||||
state.showEditCollectionModal = val
|
||||
},
|
||||
setEditCollection(state, collection) {
|
||||
state.selectedCollection = collection
|
||||
state.showEditCollectionModal = true
|
||||
}
|
||||
}
|
||||
+13
-2
@@ -12,7 +12,8 @@ export const state = () => ({
|
||||
},
|
||||
settingsListeners: [],
|
||||
collections: [],
|
||||
collectionsLoaded: false
|
||||
collectionsLoaded: false,
|
||||
collectionsListeners: []
|
||||
})
|
||||
|
||||
export const getters = {
|
||||
@@ -140,8 +141,18 @@ export const mutations = {
|
||||
} else {
|
||||
state.collections.push(collection)
|
||||
}
|
||||
state.collectionsListeners.forEach((listener) => listener.meth())
|
||||
},
|
||||
removeCollection(state, collection) {
|
||||
state.collections = state.collections.filter(c => c.id !== collection.id)
|
||||
}
|
||||
state.collectionsListeners.forEach((listener) => listener.meth())
|
||||
},
|
||||
addCollectionsListener(state, listener) {
|
||||
var index = state.collectionsListeners.findIndex(l => l.id === listener.id)
|
||||
if (index >= 0) state.collectionsListeners.splice(index, 1, listener)
|
||||
else state.collectionsListeners.push(listener)
|
||||
},
|
||||
removeCollectionsListener(state, listenerId) {
|
||||
state.collectionsListeners = state.collectionsListeners.filter(l => l.id !== listenerId)
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user