mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-14 15:59:38 +00:00
Update cover url, audiobook player speed
This commit is contained in:
parent
8fbdc1523d
commit
dee7bcb2c2
6 changed files with 58 additions and 19 deletions
|
|
@ -68,18 +68,6 @@ class Auth {
|
|||
})
|
||||
}
|
||||
|
||||
async getAuth(req) {
|
||||
if (req.signedCookies.user) {
|
||||
var user = this.users.find(u => u.username = req.signedCookies.user)
|
||||
if (user) {
|
||||
delete user.pash
|
||||
}
|
||||
return user
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
generateAccessToken(payload) {
|
||||
return jwt.sign(payload, process.env.TOKEN_SECRET, { expiresIn: '1800s' });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,6 +198,11 @@ class Server {
|
|||
var client = this.clients[socket.id]
|
||||
client.user = user
|
||||
|
||||
if (!client.user.toJSONForBrowser) {
|
||||
Logger.error('Invalid user...', client.user)
|
||||
return
|
||||
}
|
||||
|
||||
// Check if user has stream open
|
||||
if (client.user.stream) {
|
||||
Logger.info('User has stream open already', client.user.stream)
|
||||
|
|
|
|||
|
|
@ -111,6 +111,10 @@ class StreamManager {
|
|||
return
|
||||
}
|
||||
client.stream.updateClientCurrentTime(currentTime)
|
||||
if (!client.user) {
|
||||
Logger.error('No User for client', client)
|
||||
return
|
||||
}
|
||||
client.user.updateAudiobookProgress(client.stream)
|
||||
this.db.updateEntity('user', client.user.toJSON())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue