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