mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 01:35:08 +02:00
Merge pull request #3086 from taxilian/bug/itemProgressNull
bug: If !itemProgress unhandled exception syncing user progress
This commit is contained in:
commit
8498cab842
1 changed files with 9 additions and 7 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue