@@ -49,11 +49,11 @@ export class Recorder extends EventEmitter {
4949 **/
5050 isTranscribing : boolean = false ;
5151 state : RECORDER_STATE = RECORDER_STATE . STOPPED ;
52- private folder ?: Folder ;
52+ private _folder ?: Folder ;
5353 private readonly channel : Channel ; // TODO rename with private prefix
54- private readonly tasks = new Map < SessionId , RecordingTask > ( ) ;
54+ private readonly _tasks = new Map < SessionId , RecordingTask > ( ) ;
5555 /** Path to which the final recording will be uploaded to */
56- private readonly metaData : Metadata = {
56+ private readonly _metaData : Metadata = {
5757 uploadAddress : "" ,
5858 timeStamps : { }
5959 } ;
@@ -67,7 +67,7 @@ export class Recorder extends EventEmitter {
6767 this . _onSessionJoin = this . _onSessionJoin . bind ( this ) ;
6868 this . _onSessionLeave = this . _onSessionLeave . bind ( this ) ;
6969 this . channel = channel ;
70- this . metaData . uploadAddress = recordingAddress ;
70+ this . _metaData . uploadAddress = recordingAddress ;
7171 }
7272
7373 async start ( ) {
@@ -122,15 +122,15 @@ export class Recorder extends EventEmitter {
122122 logger . warn ( "recording failed at saving files" ) ; // TODO more info
123123 }
124124 if ( save && ! hasFailure ) {
125- await this . folder ?. add ( "metadata.json" , JSON . stringify ( this . metaData ) ) ;
126- await this . folder ?. seal (
125+ await this . _folder ?. add ( "metadata.json" , JSON . stringify ( this . _metaData ) ) ;
126+ await this . _folder ?. seal (
127127 path . join ( recording . directory , `${ this . channel . name } _${ Date . now ( ) } ` )
128128 ) ;
129129 } else {
130- await this . folder ?. delete ( ) ;
130+ await this . _folder ?. delete ( ) ;
131131 }
132- this . folder = undefined ;
133- this . metaData . timeStamps = { } ;
132+ this . _folder = undefined ;
133+ this . _metaData . timeStamps = { } ;
134134 this . state = RECORDER_STATE . STOPPED ;
135135 }
136136
@@ -139,21 +139,21 @@ export class Recorder extends EventEmitter {
139139 if ( ! session ) {
140140 return ;
141141 }
142- this . tasks . set ( session . id , new RecordingTask ( session , this . _getTaskParameters ( ) ) ) ;
142+ this . _tasks . set ( session . id , new RecordingTask ( session , this . _getTaskParameters ( ) ) ) ;
143143 }
144144
145145 private _onSessionLeave ( id : SessionId ) {
146- const task = this . tasks . get ( id ) ;
146+ const task = this . _tasks . get ( id ) ;
147147 if ( task ) {
148148 task . stop ( ) ;
149- this . tasks . delete ( id ) ;
149+ this . _tasks . delete ( id ) ;
150150 }
151151 }
152152
153153 private _mark ( tag : TIME_TAG ) {
154- const events = this . metaData . timeStamps [ Date . now ( ) ] || [ ] ;
154+ const events = this . _metaData . timeStamps [ Date . now ( ) ] || [ ] ;
155155 events . push ( tag ) ;
156- this . metaData . timeStamps [ Date . now ( ) ] = events ;
156+ this . _metaData . timeStamps [ Date . now ( ) ] = events ;
157157 }
158158
159159 private async _refreshConfiguration ( ) {
@@ -177,28 +177,28 @@ export class Recorder extends EventEmitter {
177177
178178 private async _update ( ) {
179179 const params = this . _getTaskParameters ( ) ;
180- for ( const task of this . tasks . values ( ) ) {
180+ for ( const task of this . _tasks . values ( ) ) {
181181 Object . assign ( task , params ) ;
182182 }
183183 }
184184
185185 private async _init ( ) {
186186 this . state = RECORDER_STATE . STARTED ;
187- this . folder = await getFolder ( ) ;
187+ this . _folder = await getFolder ( ) ;
188188 logger . trace ( `TO IMPLEMENT: recording channel ${ this . channel . name } ` ) ;
189189 for ( const [ sessionId , session ] of this . channel . sessions ) {
190- this . tasks . set ( sessionId , new RecordingTask ( session , this . _getTaskParameters ( ) ) ) ;
190+ this . _tasks . set ( sessionId , new RecordingTask ( session , this . _getTaskParameters ( ) ) ) ;
191191 }
192192 this . channel . on ( "sessionJoin" , this . _onSessionJoin ) ;
193193 this . channel . on ( "sessionLeave" , this . _onSessionLeave ) ;
194194 }
195195
196196 private async _stopTasks ( ) {
197197 const proms = [ ] ;
198- for ( const task of this . tasks . values ( ) ) {
198+ for ( const task of this . _tasks . values ( ) ) {
199199 proms . push ( task . stop ( ) ) ;
200200 }
201- this . tasks . clear ( ) ;
201+ this . _tasks . clear ( ) ;
202202 return Promise . allSettled ( proms ) ;
203203 }
204204
0 commit comments