diff --git a/client/components/app/StreamContainer.vue b/client/components/app/StreamContainer.vue index bce083fa..2b64756c 100644 --- a/client/components/app/StreamContainer.vue +++ b/client/components/app/StreamContainer.vue @@ -312,7 +312,7 @@ export default { console.error('No Audio Ref') } }, - sessionOpen(session) { + sessionOpen(session) { // For opening session on init (temporarily unused) this.$store.commit('setMediaPlaying', { libraryItem: session.libraryItem, episodeId: session.episodeId diff --git a/client/layouts/default.vue b/client/layouts/default.vue index 903e1dac..5a4b2f89 100644 --- a/client/layouts/default.vue +++ b/client/layouts/default.vue @@ -111,21 +111,8 @@ export default { reconnectFailed() { console.error('[SOCKET] reconnect failed') }, - init(payload, count = 0) { - if (!this.$refs.streamContainer) { - if (count > 20) { - console.error('Stream container never mounted') - return - } - setTimeout(() => { - this.init(payload, ++count) - }, 100) - return - } + init(payload) { console.log('Init Payload', payload) - if (payload.session) { - this.$refs.streamContainer.sessionOpen(payload.session) - } // Start scans currently running if (payload.librariesScanning) { diff --git a/server/Server.js b/server/Server.js index 7bf6e643..2d4e08c6 100644 --- a/server/Server.js +++ b/server/Server.js @@ -440,26 +440,7 @@ class Server { return } - // Check if user has session open - var session = this.playbackSessionManager.getUserSession(user.id) - if (session) { - Logger.debug(`[Server] User Online "${client.user.username}" with session open "${session.id}"`) - var sessionLibraryItem = this.db.libraryItems.find(li => li.id === session.libraryItemId) - if (!sessionLibraryItem) { - Logger.error(`[Server] Library Item for session "${session.id}" does not exist "${session.libraryItemId}"`) - this.playbackSessionManager.removeSession(session.id) - session = null - } else if (session.mediaType === 'podcast' && !sessionLibraryItem.media.checkHasEpisode(session.episodeId)) { - Logger.error(`[Server] Library Item for session "${session.id}" episode ${session.episodeId} does not exist "${session.libraryItemId}"`) - this.playbackSessionManager.removeSession(session.id) - session = null - } - if (session) { - session = session.toJSONForClient(sessionLibraryItem) - } - } else { - Logger.debug(`[Server] User Online ${client.user.username}`) - } + Logger.debug(`[Server] User Online ${client.user.username}`) this.io.emit('user_online', client.user.toJSONForPublic(this.playbackSessionManager.sessions, this.db.libraryItems)) @@ -470,7 +451,6 @@ class Server { metadataPath: global.MetadataPath, configPath: global.ConfigPath, user: client.user.toJSONForBrowser(), - session, librariesScanning: this.scanner.librariesScanning, backups: (this.backupManager.backups || []).map(b => b.toJSON()) }