From 02339b50b44cfd7087a0e90b2408003fdd06b373 Mon Sep 17 00:00:00 2001 From: juancarmore Date: Wed, 13 Aug 2025 20:31:30 +0200 Subject: [PATCH] frontend: rename RecordingManagerService to RecordingService --- .../share-recording-dialog.component.ts | 4 +-- .../src/lib/guards/auth.guard.ts | 4 +-- .../src/lib/guards/validate-access.guard.ts | 4 +-- .../src/lib/interceptors/http.interceptor.ts | 4 +-- .../console/overview/overview.component.ts | 4 +-- .../recordings/recordings.component.ts | 4 +-- .../lib/pages/meeting/meeting.component.ts | 26 +++++++++---------- .../room-recordings.component.ts | 4 +-- .../view-recording.component.ts | 4 +-- .../src/lib/services/index.ts | 2 +- ...anager.service.ts => recording.service.ts} | 2 +- 11 files changed, 31 insertions(+), 31 deletions(-) rename frontend/projects/shared-meet-components/src/lib/services/{recording-manager.service.ts => recording.service.ts} (99%) diff --git a/frontend/projects/shared-meet-components/src/lib/components/dialogs/share-recording-dialog/share-recording-dialog.component.ts b/frontend/projects/shared-meet-components/src/lib/components/dialogs/share-recording-dialog/share-recording-dialog.component.ts index 3d8415e..243e48e 100644 --- a/frontend/projects/shared-meet-components/src/lib/components/dialogs/share-recording-dialog/share-recording-dialog.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/components/dialogs/share-recording-dialog/share-recording-dialog.component.ts @@ -15,7 +15,7 @@ import { MatInputModule } from '@angular/material/input'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatRadioModule } from '@angular/material/radio'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { RecordingManagerService } from '@lib/services'; +import { RecordingService } from '@lib/services'; @Component({ selector: 'ov-share-recording-dialog', @@ -48,7 +48,7 @@ export class ShareRecordingDialogComponent { constructor( @Inject(MAT_DIALOG_DATA) public data: { recordingId: string; recordingUrl?: string }, - private recordingService: RecordingManagerService, + private recordingService: RecordingService, private clipboard: Clipboard ) { this.recordingUrl = data.recordingUrl; diff --git a/frontend/projects/shared-meet-components/src/lib/guards/auth.guard.ts b/frontend/projects/shared-meet-components/src/lib/guards/auth.guard.ts index 91e5cfd..7bf2337 100644 --- a/frontend/projects/shared-meet-components/src/lib/guards/auth.guard.ts +++ b/frontend/projects/shared-meet-components/src/lib/guards/auth.guard.ts @@ -6,7 +6,7 @@ import { GlobalPreferencesService, NavigationService, ParticipantService, - RecordingManagerService, + RecordingService, RoomService } from '@lib/services'; import { AuthMode, ParticipantRole } from '@lib/typings/ce'; @@ -107,7 +107,7 @@ export const checkRecordingAuthGuard: CanActivateFn = async ( route: ActivatedRouteSnapshot, state: RouterStateSnapshot ) => { - const recordingService = inject(RecordingManagerService); + const recordingService = inject(RecordingService); const navigationService = inject(NavigationService); const recordingId = route.params['recording-id']; diff --git a/frontend/projects/shared-meet-components/src/lib/guards/validate-access.guard.ts b/frontend/projects/shared-meet-components/src/lib/guards/validate-access.guard.ts index 5d258c8..f9ade41 100644 --- a/frontend/projects/shared-meet-components/src/lib/guards/validate-access.guard.ts +++ b/frontend/projects/shared-meet-components/src/lib/guards/validate-access.guard.ts @@ -1,7 +1,7 @@ import { inject } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivateFn, RouterStateSnapshot } from '@angular/router'; import { ErrorReason } from '@lib/models'; -import { NavigationService, ParticipantService, RecordingManagerService, RoomService } from '@lib/services'; +import { NavigationService, ParticipantService, RecordingService, RoomService } from '@lib/services'; /** * Guard to validate the access to recordings of a room by generating a recording token. @@ -11,7 +11,7 @@ export const validateRecordingAccessGuard: CanActivateFn = async ( _state: RouterStateSnapshot ) => { const roomService = inject(RoomService); - const recordingService = inject(RecordingManagerService); + const recordingService = inject(RecordingService); const navigationService = inject(NavigationService); const roomId = roomService.getRoomId(); diff --git a/frontend/projects/shared-meet-components/src/lib/interceptors/http.interceptor.ts b/frontend/projects/shared-meet-components/src/lib/interceptors/http.interceptor.ts index fc56acd..d9cbf29 100644 --- a/frontend/projects/shared-meet-components/src/lib/interceptors/http.interceptor.ts +++ b/frontend/projects/shared-meet-components/src/lib/interceptors/http.interceptor.ts @@ -1,7 +1,7 @@ import { HttpErrorResponse, HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http'; import { inject } from '@angular/core'; import { Router } from '@angular/router'; -import { AuthService, ParticipantService, RecordingManagerService, RoomService } from '@lib/services'; +import { AuthService, ParticipantService, RecordingService, RoomService } from '@lib/services'; import { catchError, from, Observable, switchMap } from 'rxjs'; export const httpInterceptor: HttpInterceptorFn = (req: HttpRequest, next: HttpHandlerFn) => { @@ -9,7 +9,7 @@ export const httpInterceptor: HttpInterceptorFn = (req: HttpRequest, ne const authService: AuthService = inject(AuthService); const roomService = inject(RoomService); const participantTokenService = inject(ParticipantService); - const recordingService = inject(RecordingManagerService); + const recordingService = inject(RecordingService); const pageUrl = router.getCurrentNavigation()?.finalUrl?.toString() || router.url; const requestUrl = req.url; diff --git a/frontend/projects/shared-meet-components/src/lib/pages/console/overview/overview.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/console/overview/overview.component.ts index 11a7e54..2aa7fae 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/console/overview/overview.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/console/overview/overview.component.ts @@ -4,7 +4,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatGridListModule } from '@angular/material/grid-list'; import { MatIconModule } from '@angular/material/icon'; -import { NavigationService, RecordingManagerService, RoomService } from '@lib/services'; +import { NavigationService, RecordingService, RoomService } from '@lib/services'; import { MeetRecordingStatus, MeetRoom } from '@lib/typings/ce'; interface OverviewStats { @@ -35,7 +35,7 @@ export class OverviewComponent implements OnInit { constructor( private roomService: RoomService, - private recordingService: RecordingManagerService, + private recordingService: RecordingService, private navigationService: NavigationService ) {} diff --git a/frontend/projects/shared-meet-components/src/lib/pages/console/recordings/recordings.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/console/recordings/recordings.component.ts index e2deb62..c387bba 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/console/recordings/recordings.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/console/recordings/recordings.component.ts @@ -3,7 +3,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { ActivatedRoute } from '@angular/router'; import { RecordingListsComponent, RecordingTableAction } from '@lib/components'; -import { NotificationService, RecordingManagerService } from '@lib/services'; +import { NotificationService, RecordingService } from '@lib/services'; import { MeetRecordingFilters, MeetRecordingInfo } from '@lib/typings/ce'; import { ILogger, LoggerService } from 'openvidu-components-angular'; @@ -27,7 +27,7 @@ export class RecordingsComponent implements OnInit { constructor( protected loggerService: LoggerService, - private recordingService: RecordingManagerService, + private recordingService: RecordingService, private notificationService: NotificationService, protected route: ActivatedRoute ) { diff --git a/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts index d2af9b2..a82e833 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts @@ -23,7 +23,7 @@ import { NavigationService, NotificationService, ParticipantService, - RecordingManagerService, + RecordingService, RoomService, SessionStorageService, WebComponentManagerService @@ -106,8 +106,7 @@ export class MeetingComponent implements OnInit { constructor( protected route: ActivatedRoute, protected navigationService: NavigationService, - protected participantTokenService: ParticipantService, - protected recManagerService: RecordingManagerService, + protected recordingService: RecordingService, protected authService: AuthService, protected roomService: RoomService, protected meetingService: MeetingService, @@ -119,8 +118,7 @@ export class MeetingComponent implements OnInit { protected sessionStorageService: SessionStorageService, protected featureConfService: FeatureConfigurationService, protected clipboard: Clipboard, - protected notificationService: NotificationService, - protected recordingService: RecordingManagerService + protected notificationService: NotificationService ) { this.features = this.featureConfService.features; } @@ -177,8 +175,8 @@ export class MeetingComponent implements OnInit { */ private async checkForRecordings() { try { - await this.recManagerService.generateRecordingToken(this.roomId, this.roomSecret); - const { recordings } = await this.recManagerService.listRecordings({ + await this.recordingService.generateRecordingToken(this.roomId, this.roomSecret); + const { recordings } = await this.recordingService.listRecordings({ maxItems: 1, roomId: this.roomId, fields: 'recordingId' @@ -201,7 +199,7 @@ export class MeetingComponent implements OnInit { */ private async initializeParticipantName() { // Apply participant name from ParticipantTokenService if set, otherwise use authenticated username - const currentParticipantName = this.participantTokenService.getParticipantName(); + const currentParticipantName = this.participantService.getParticipantName(); const username = await this.authService.getUsername(); const participantName = currentParticipantName || username; @@ -251,7 +249,7 @@ export class MeetingComponent implements OnInit { } this.participantName = value.name.trim(); - this.participantTokenService.setParticipantName(this.participantName); + this.participantService.setParticipantName(this.participantName); try { await this.generateParticipantToken(); @@ -282,7 +280,7 @@ export class MeetingComponent implements OnInit { */ private async generateParticipantToken() { try { - this.participantToken = await this.participantTokenService.generateToken({ + this.participantToken = await this.participantService.generateToken({ roomId: this.roomId, secret: this.roomSecret, participantName: this.participantName @@ -465,11 +463,13 @@ export class MeetingComponent implements OnInit { async onRecordingStartRequested(event: RecordingStartRequestedEvent) { try { - await this.recManagerService.startRecording(event.roomName); + await this.recordingService.startRecording(event.roomName); } catch (error: unknown) { if ((error as any).status === 503) { console.error( - "No egress service was able to register a request. Check your CPU usage or if there's any Media Node with enough CPU. Remember that by default, a recording uses 4 CPUs for each room." + `No egress service was able to register a request. +Check your CPU usage or if there's any Media Node with enough CPU. +Remember that by default, a recording uses 4 CPUs for each room.` ); } else { console.error(error); @@ -479,7 +479,7 @@ export class MeetingComponent implements OnInit { async onRecordingStopRequested(event: RecordingStopRequestedEvent) { try { - await this.recManagerService.stopRecording(event.recordingId); + await this.recordingService.stopRecording(event.recordingId); } catch (error) { console.error(error); } diff --git a/frontend/projects/shared-meet-components/src/lib/pages/room-recordings/room-recordings.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/room-recordings/room-recordings.component.ts index 2ea344d..ce65aea 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/room-recordings/room-recordings.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/room-recordings/room-recordings.component.ts @@ -5,7 +5,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatToolbarModule } from '@angular/material/toolbar'; import { ActivatedRoute } from '@angular/router'; import { RecordingListsComponent, RecordingTableAction } from '@lib/components'; -import { NavigationService, NotificationService, RecordingManagerService, RoomService } from '@lib/services'; +import { NavigationService, NotificationService, RecordingService, RoomService } from '@lib/services'; import { MeetRecordingFilters, MeetRecordingInfo } from '@lib/typings/ce'; import { ILogger, LoggerService } from 'openvidu-components-angular'; @@ -33,7 +33,7 @@ export class RoomRecordingsComponent implements OnInit { constructor( protected loggerService: LoggerService, - protected recordingService: RecordingManagerService, + protected recordingService: RecordingService, protected roomService: RoomService, protected notificationService: NotificationService, protected navigationService: NavigationService, diff --git a/frontend/projects/shared-meet-components/src/lib/pages/view-recording/view-recording.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/view-recording/view-recording.component.ts index 083696d..8163872 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/view-recording/view-recording.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/view-recording/view-recording.component.ts @@ -7,7 +7,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MatTooltipModule } from '@angular/material/tooltip'; import { ActivatedRoute, Router } from '@angular/router'; -import { NotificationService, RecordingManagerService } from '@lib/services'; +import { NotificationService, RecordingService } from '@lib/services'; import { MeetRecordingInfo, MeetRecordingStatus } from '@lib/typings/ce'; import { formatDurationToTime } from '@lib/utils'; @@ -35,7 +35,7 @@ export class ViewRecordingComponent implements OnInit { isVideoLoaded = false; constructor( - protected recordingService: RecordingManagerService, + protected recordingService: RecordingService, protected notificationService: NotificationService, protected route: ActivatedRoute, protected router: Router diff --git a/frontend/projects/shared-meet-components/src/lib/services/index.ts b/frontend/projects/shared-meet-components/src/lib/services/index.ts index 0d62197..d447206 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/index.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/index.ts @@ -6,7 +6,7 @@ export * from './room.service'; export * from './participant.service'; export * from './meeting.service'; export * from './feature-configuration.service'; -export * from './recording-manager.service'; +export * from './recording.service'; export * from './webcomponent-manager.service'; export * from './navigation.service'; export * from './notification.service'; diff --git a/frontend/projects/shared-meet-components/src/lib/services/recording-manager.service.ts b/frontend/projects/shared-meet-components/src/lib/services/recording.service.ts similarity index 99% rename from frontend/projects/shared-meet-components/src/lib/services/recording-manager.service.ts rename to frontend/projects/shared-meet-components/src/lib/services/recording.service.ts index fcb8b9a..9a95318 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/recording-manager.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/recording.service.ts @@ -9,7 +9,7 @@ import { LoggerService } from 'openvidu-components-angular'; @Injectable({ providedIn: 'root' }) -export class RecordingManagerService { +export class RecordingService { protected readonly RECORDINGS_API = `${HttpService.API_PATH_PREFIX}/recordings`; protected readonly INTERNAL_RECORDINGS_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/recordings`;