Add: Experimental collections add/remove & db #151

This commit is contained in:
advplyr 2021-11-05 20:24:02 -05:00
parent 3d35b7dc3d
commit bf0893d759
27 changed files with 784 additions and 62 deletions

View file

@ -7,6 +7,7 @@
<app-stream-container ref="streamContainer" />
<modals-edit-modal />
<modals-user-collections-modal />
<readers-reader />
</div>
</template>
@ -181,6 +182,15 @@ export default {
// console.log('Received user audiobook update', payload)
this.$store.commit('user/updateUserAudiobook', payload)
},
collectionAdded(collection) {
this.$store.commit('user/addUpdateCollection', collection)
},
collectionUpdated(collection) {
this.$store.commit('user/addUpdateCollection', collection)
},
collectionRemoved(collection) {
this.$store.commit('user/removeCollection', collection)
},
downloadToastClick(download) {
if (!download || !download.audiobookId) {
return console.error('Invalid download object', download)
@ -294,6 +304,11 @@ export default {
this.socket.on('user_stream_update', this.userStreamUpdate)
this.socket.on('current_user_audiobook_update', this.currentUserAudiobookUpdate)
// User Collection Listeners
this.socket.on('collection_added', this.collectionAdded)
this.socket.on('collection_updated', this.collectionUpdated)
this.socket.on('collection_removed', this.collectionRemoved)
// Scan Listeners
this.socket.on('scan_start', this.scanStart)
this.socket.on('scan_complete', this.scanComplete)