mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-22 20:04:38 +02:00
Fix: audiobook progress emitter emit to all user sockets #145, Fix: save user after progress update
This commit is contained in:
parent
c5eafdfa8a
commit
8b31c6555a
7 changed files with 30 additions and 14 deletions
|
@ -5,10 +5,11 @@ const fs = require('fs-extra')
|
|||
const Path = require('path')
|
||||
|
||||
class StreamManager {
|
||||
constructor(db, MetadataPath, emitter) {
|
||||
constructor(db, MetadataPath, emitter, clientEmitter) {
|
||||
this.db = db
|
||||
|
||||
this.emitter = emitter
|
||||
this.clientEmitter = clientEmitter
|
||||
|
||||
this.MetadataPath = MetadataPath
|
||||
this.streams = []
|
||||
|
@ -157,7 +158,7 @@ class StreamManager {
|
|||
this.db.updateEntity('user', client.user)
|
||||
|
||||
if (userAudiobook) {
|
||||
socket.emit('current_user_audiobook_update', {
|
||||
this.clientEmitter(client.user.id, 'current_user_audiobook_update', {
|
||||
id: userAudiobook.audiobookId,
|
||||
data: userAudiobook.toJSON()
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue