Fix:Open playback session on init #743

This commit is contained in:
advplyr 2022-06-18 13:11:15 -05:00
parent fd13607d89
commit 19f020e7a6
3 changed files with 5 additions and 9 deletions

View File

@ -110,13 +110,7 @@ export default {
}
console.log('Init Payload', payload)
if (payload.session) {
if (this.$refs.streamContainer) {
this.$refs.streamContainer.sessionOpen(payload.session)
} else {
console.warn('Stream Container not mounted')
}
}
if (payload.serverSettings) {
this.$refs.streamContainer.sessionOpen(payload.session)
}
// Start scans currently running

View File

@ -177,12 +177,13 @@ export default class PlayerHandler {
}
prepareOpenSession(session, playbackRate) { // Session opened on init socket
if (!this.player) this.switchPlayer() // Must set player first for open sessions
this.libraryItem = session.libraryItem
this.isVideo = session.libraryItem.mediaType === 'video'
this.playWhenReady = false
this.initialPlaybackRate = playbackRate
if (!this.player) this.switchPlayer()
this.prepareSession(session)
}

View File

@ -140,7 +140,7 @@ class Server {
await this.purgeMetadata() // Remove metadata folders without library item
await this.cacheManager.ensureCachePaths()
await this.abMergeManager.ensureDownloadDirPath()
await this.backupManager.init()
await this.logManager.init()
await this.rssFeedManager.init()
@ -451,6 +451,7 @@ class Server {
} else {
Logger.debug(`[Server] User Online ${client.user.username}`)
}
this.io.emit('user_online', client.user.toJSONForPublic(this.playbackSessionManager.sessions, this.db.libraryItems))
user.lastSeen = Date.now()