mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-01 00:18:14 +01:00
Merge pull request #3086 from taxilian/bug/itemProgressNull
bug: If !itemProgress unhandled exception syncing user progress
This commit is contained in:
commit
8498cab842
@ -178,13 +178,15 @@ class PlaybackSessionManager {
|
|||||||
// Update user and emit socket event
|
// Update user and emit socket event
|
||||||
if (result.progressSynced) {
|
if (result.progressSynced) {
|
||||||
const itemProgress = user.getMediaProgress(session.libraryItemId, session.episodeId)
|
const itemProgress = user.getMediaProgress(session.libraryItemId, session.episodeId)
|
||||||
if (itemProgress) await Database.upsertMediaProgress(itemProgress)
|
if (itemProgress) {
|
||||||
SocketAuthority.clientEmitter(user.id, 'user_item_progress_updated', {
|
await Database.upsertMediaProgress(itemProgress)
|
||||||
id: itemProgress.id,
|
SocketAuthority.clientEmitter(user.id, 'user_item_progress_updated', {
|
||||||
sessionId: session.id,
|
id: itemProgress.id,
|
||||||
deviceDescription: session.deviceDescription,
|
sessionId: session.id,
|
||||||
data: itemProgress.toJSON()
|
deviceDescription: session.deviceDescription,
|
||||||
})
|
data: itemProgress.toJSON()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user