From 3c4af147a8faf7d2c48627be4f47635c9aacb52a Mon Sep 17 00:00:00 2001 From: 4gray Date: Sat, 15 Nov 2025 14:27:08 +0100 Subject: [PATCH] refactor(player): remove unused PlayerDialog and SafePipe Remove the PlayerDialogComponent (TS, HTML, SCSS) and the standalone SafePipe from the xtream feature. These files were deleted because the dialog and pipe are no longer used by the application, reducing dead code and simplifying the web module surface. This change prevents maintaining UI code (player markup, styles, and clipboard/snackbar logic) and an unused DOM sanitizer pipe, improving project maintainability and build size. --- .../player-dialog.component.html | 25 --------- .../player-dialog.component.scss | 22 -------- .../player-dialog/player-dialog.component.ts | 54 ------------------- .../src/app/xtream/vod-details/safe.pipe.ts | 11 ---- 4 files changed, 112 deletions(-) delete mode 100644 apps/web/src/app/xtream/player-dialog/player-dialog.component.html delete mode 100644 apps/web/src/app/xtream/player-dialog/player-dialog.component.scss delete mode 100644 apps/web/src/app/xtream/player-dialog/player-dialog.component.ts delete mode 100644 apps/web/src/app/xtream/vod-details/safe.pipe.ts diff --git a/apps/web/src/app/xtream/player-dialog/player-dialog.component.html b/apps/web/src/app/xtream/player-dialog/player-dialog.component.html deleted file mode 100644 index 34bd66a04..000000000 --- a/apps/web/src/app/xtream/player-dialog/player-dialog.component.html +++ /dev/null @@ -1,25 +0,0 @@ -

{{ title }}

- - - - - - - - - - diff --git a/apps/web/src/app/xtream/player-dialog/player-dialog.component.scss b/apps/web/src/app/xtream/player-dialog/player-dialog.component.scss deleted file mode 100644 index d2371f35a..000000000 --- a/apps/web/src/app/xtream/player-dialog/player-dialog.component.scss +++ /dev/null @@ -1,22 +0,0 @@ -@use '@angular/material' as mat; - -.content { - overflow: hidden; - padding: 10px !important; -} - -.link-input { - width: 98%; - padding-top: 5px; - @include mat.form-field-density(-5); -} - -.align-actions { - justify-content: space-between; -} - -mat-dialog-content { - .video-js { - height: 500px !important; - } -} \ No newline at end of file diff --git a/apps/web/src/app/xtream/player-dialog/player-dialog.component.ts b/apps/web/src/app/xtream/player-dialog/player-dialog.component.ts deleted file mode 100644 index dc4c4d6c8..000000000 --- a/apps/web/src/app/xtream/player-dialog/player-dialog.component.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { ClipboardModule } from '@angular/cdk/clipboard'; -import { Component, inject, ViewEncapsulation } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { WebPlayerViewComponent } from 'shared-portals'; - -export interface PlayerDialogData { - streamUrl: string; - title: string; -} - -@Component({ - templateUrl: './player-dialog.component.html', - imports: [ - ClipboardModule, - MatButtonModule, - MatDialogModule, - MatFormFieldModule, - MatIconModule, - MatInputModule, - TranslateModule, - WebPlayerViewComponent, - ], - styleUrl: './player-dialog.component.scss', - encapsulation: ViewEncapsulation.None, -}) -export class PlayerDialogComponent { - readonly data = inject(MAT_DIALOG_DATA) as PlayerDialogData; - private snackBar = inject(MatSnackBar); - private translateService = inject(TranslateService); - - readonly title: string; - readonly streamUrl: string; - - constructor() { - this.streamUrl = this.data.streamUrl; - this.title = this.data.title; - } - - showCopyNotification() { - this.snackBar.open( - this.translateService.instant('PORTALS.STREAM_URL_COPIED'), - null, - { - duration: 2000, - } - ); - } -} diff --git a/apps/web/src/app/xtream/vod-details/safe.pipe.ts b/apps/web/src/app/xtream/vod-details/safe.pipe.ts deleted file mode 100644 index d91d2fcec..000000000 --- a/apps/web/src/app/xtream/vod-details/safe.pipe.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { DomSanitizer } from '@angular/platform-browser'; - -@Pipe({ name: 'safe', standalone: true }) -export class SafePipe implements PipeTransform { - constructor(private sanitizer: DomSanitizer) {} - - transform(url: string) { - return this.sanitizer.bypassSecurityTrustResourceUrl(url); - } -}