mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-07-28 23:48:45 +02:00
Merge branch 'master' into master
This commit is contained in:
@@ -198,6 +198,10 @@ class AbsDatabaseWeb extends WebPlugin {
|
||||
async updateLocalTrackOrder({ localLibraryItemId, tracks }) {
|
||||
return []
|
||||
}
|
||||
|
||||
async updateLocalMediaProgressFinished({ localMediaProgressId, isFinished }) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
const AbsDatabase = registerPlugin('AbsDatabase', {
|
||||
|
||||
@@ -98,6 +98,11 @@ class DbService {
|
||||
updateLocalTrackOrder(payload) {
|
||||
return AbsDatabase.updateLocalTrackOrder(payload)
|
||||
}
|
||||
|
||||
// input: { localMediaProgressId:String, isFinished:Boolean }
|
||||
updateLocalMediaProgressFinished(payload) {
|
||||
return AbsDatabase.updateLocalMediaProgressFinished(payload)
|
||||
}
|
||||
}
|
||||
|
||||
export default ({ app, store }, inject) => {
|
||||
|
||||
+8
-1
@@ -46,9 +46,10 @@ class ServerSocket extends EventEmitter {
|
||||
this.socket.on('disconnect', this.onDisconnect.bind(this))
|
||||
this.socket.on('init', this.onInit.bind(this))
|
||||
this.socket.on('user_updated', this.onUserUpdated.bind(this))
|
||||
this.socket.on('user_item_progress_updated', this.onUserItemProgressUpdated.bind(this))
|
||||
|
||||
this.socket.onAny((evt, args) => {
|
||||
console.log(`[SOCKET] ${this.socket.id}: ${evt} ${JSON.stringify(args)}`)
|
||||
console.log(`[SOCKET] onAny: ${this.socket.id}: ${evt} ${JSON.stringify(args)}`)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -84,6 +85,12 @@ class ServerSocket extends EventEmitter {
|
||||
console.log('[SOCKET] User updated', data)
|
||||
this.emit('user_updated', data)
|
||||
}
|
||||
|
||||
onUserItemProgressUpdated(data) {
|
||||
console.log('[SOCKET] User Item Progress Updated', JSON.stringify(data))
|
||||
var progress = data.data
|
||||
this.$store.commit('user/updateUserMediaProgress', progress)
|
||||
}
|
||||
}
|
||||
|
||||
export default ({ app, store }, inject) => {
|
||||
|
||||
Reference in New Issue
Block a user