mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-28 01:29:27 +01:00
Update:Audio player does not open on load
This commit is contained in:
parent
ff6d95dc4d
commit
be28b9899e
@ -312,7 +312,7 @@ export default {
|
|||||||
console.error('No Audio Ref')
|
console.error('No Audio Ref')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sessionOpen(session) {
|
sessionOpen(session) { // For opening session on init (temporarily unused)
|
||||||
this.$store.commit('setMediaPlaying', {
|
this.$store.commit('setMediaPlaying', {
|
||||||
libraryItem: session.libraryItem,
|
libraryItem: session.libraryItem,
|
||||||
episodeId: session.episodeId
|
episodeId: session.episodeId
|
||||||
|
@ -111,21 +111,8 @@ export default {
|
|||||||
reconnectFailed() {
|
reconnectFailed() {
|
||||||
console.error('[SOCKET] reconnect failed')
|
console.error('[SOCKET] reconnect failed')
|
||||||
},
|
},
|
||||||
init(payload, count = 0) {
|
init(payload) {
|
||||||
if (!this.$refs.streamContainer) {
|
|
||||||
if (count > 20) {
|
|
||||||
console.error('Stream container never mounted')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
this.init(payload, ++count)
|
|
||||||
}, 100)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
console.log('Init Payload', payload)
|
console.log('Init Payload', payload)
|
||||||
if (payload.session) {
|
|
||||||
this.$refs.streamContainer.sessionOpen(payload.session)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start scans currently running
|
// Start scans currently running
|
||||||
if (payload.librariesScanning) {
|
if (payload.librariesScanning) {
|
||||||
|
@ -440,26 +440,7 @@ class Server {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if user has session open
|
Logger.debug(`[Server] User Online ${client.user.username}`)
|
||||||
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}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
this.io.emit('user_online', client.user.toJSONForPublic(this.playbackSessionManager.sessions, this.db.libraryItems))
|
this.io.emit('user_online', client.user.toJSONForPublic(this.playbackSessionManager.sessions, this.db.libraryItems))
|
||||||
|
|
||||||
@ -470,7 +451,6 @@ class Server {
|
|||||||
metadataPath: global.MetadataPath,
|
metadataPath: global.MetadataPath,
|
||||||
configPath: global.ConfigPath,
|
configPath: global.ConfigPath,
|
||||||
user: client.user.toJSONForBrowser(),
|
user: client.user.toJSONForBrowser(),
|
||||||
session,
|
|
||||||
librariesScanning: this.scanner.librariesScanning,
|
librariesScanning: this.scanner.librariesScanning,
|
||||||
backups: (this.backupManager.backups || []).map(b => b.toJSON())
|
backups: (this.backupManager.backups || []).map(b => b.toJSON())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user