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
|
||||
if (result.progressSynced) {
|
||||
const itemProgress = user.getMediaProgress(session.libraryItemId, session.episodeId)
|
||||
if (itemProgress) await Database.upsertMediaProgress(itemProgress)
|
||||
SocketAuthority.clientEmitter(user.id, 'user_item_progress_updated', {
|
||||
id: itemProgress.id,
|
||||
sessionId: session.id,
|
||||
deviceDescription: session.deviceDescription,
|
||||
data: itemProgress.toJSON()
|
||||
})
|
||||
if (itemProgress) {
|
||||
await Database.upsertMediaProgress(itemProgress)
|
||||
SocketAuthority.clientEmitter(user.id, 'user_item_progress_updated', {
|
||||
id: itemProgress.id,
|
||||
sessionId: session.id,
|
||||
deviceDescription: session.deviceDescription,
|
||||
data: itemProgress.toJSON()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
|
Loading…
Reference in New Issue
Block a user