Merge pull request #3086 from taxilian/bug/itemProgressNull

bug: If !itemProgress unhandled exception syncing user progress
This commit is contained in:
advplyr 2024-06-19 15:28:46 -05:00 committed by GitHub
commit 8498cab842
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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