mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 01:35:08 +02:00
Update:Refactor socket connection management into SocketAuthority
This commit is contained in:
parent
42e68edc65
commit
e2af33e136
22 changed files with 386 additions and 341 deletions
|
@ -1,14 +1,17 @@
|
|||
const express = require('express')
|
||||
const Path = require('path')
|
||||
const fs = require('../libs/fsExtra')
|
||||
|
||||
const Logger = require('../Logger')
|
||||
const SocketAuthority = require('../SocketAuthority')
|
||||
|
||||
const fs = require('../libs/fsExtra')
|
||||
|
||||
|
||||
class HlsRouter {
|
||||
constructor(db, auth, playbackSessionManager, emitter) {
|
||||
constructor(db, auth, playbackSessionManager) {
|
||||
this.db = db
|
||||
this.auth = auth
|
||||
this.playbackSessionManager = playbackSessionManager
|
||||
this.emitter = emitter
|
||||
|
||||
this.router = express()
|
||||
this.init()
|
||||
|
@ -49,7 +52,7 @@ class HlsRouter {
|
|||
if (startTimeForReset) {
|
||||
// HLS.js will restart the stream at the new time
|
||||
Logger.info(`[HlsRouter] Resetting Stream - notify client @${startTimeForReset}s`)
|
||||
this.emitter('stream_reset', {
|
||||
SocketAuthority.emitter('stream_reset', {
|
||||
startTime: startTimeForReset,
|
||||
streamId: stream.id
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue