From 28397328f1bd4b3829bc09f3887b65851b5fdec5 Mon Sep 17 00:00:00 2001 From: Quickkill0 Date: Thu, 15 Jan 2026 19:27:44 -0800 Subject: [PATCH 1/2] fix: resolve build errors and add volume control to narration player - Fix TypeScript null safety issues in narration-player component template - Add optional chaining for activeJob properties - Change calculateTotalTime from private to protected for template access - Fix SCSS darken() incompatibility with CSS variables - Add DecimalPipe import to manage-narration-settings component - Add volume control with slider and dynamic icon to audio player --- .../manage-narration-settings.component.ts | 5 +- .../narration-player.component.html | 27 +++++++--- .../narration-player.component.scss | 49 ++++++++++++++++++- .../narration-player.component.ts | 16 +++++- 4 files changed, 86 insertions(+), 11 deletions(-) diff --git a/UI/Web/src/app/admin/manage-narration-settings/manage-narration-settings.component.ts b/UI/Web/src/app/admin/manage-narration-settings/manage-narration-settings.component.ts index 25db1a9bc2..7505c99eb1 100644 --- a/UI/Web/src/app/admin/manage-narration-settings/manage-narration-settings.component.ts +++ b/UI/Web/src/app/admin/manage-narration-settings/manage-narration-settings.component.ts @@ -22,7 +22,7 @@ import { } from '../_models/narration-settings'; import { SettingItemComponent } from '../../settings/_components/setting-item/setting-item.component'; import { SettingSwitchComponent } from '../../settings/_components/setting-switch/setting-switch.component'; -import { NgClass } from '@angular/common'; +import { DecimalPipe, NgClass } from '@angular/common'; import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; @Component({ @@ -36,7 +36,8 @@ import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; SettingItemComponent, SettingSwitchComponent, NgClass, - NgbTooltip + NgbTooltip, + DecimalPipe ] }) export class ManageNarrationSettingsComponent implements OnInit { diff --git a/UI/Web/src/app/book-reader/_components/narration-player/narration-player.component.html b/UI/Web/src/app/book-reader/_components/narration-player/narration-player.component.html index 772c33ba62..edb38e6cc4 100644 --- a/UI/Web/src/app/book-reader/_components/narration-player/narration-player.component.html +++ b/UI/Web/src/app/book-reader/_components/narration-player/narration-player.component.html @@ -37,7 +37,7 @@
{{ t('listen') }}
} - @if (!loading && chapterInfo?.isGenerating && chapterInfo.activeJob) { + @if (!loading && chapterInfo?.isGenerating && chapterInfo?.activeJob) {
@@ -46,14 +46,14 @@
{{ t('listen') }}
+ [style.width.%]="chapterInfo?.activeJob?.progress || 0">
- {{ chapterInfo.activeJob.progress | number:'1.0-0' }}% + {{ (chapterInfo?.activeJob?.progress || 0) | number:'1.0-0' }}%
- @if (chapterInfo.activeJob.estimatedSecondsRemaining) { + @if (chapterInfo?.activeJob?.estimatedSecondsRemaining) {
- {{ t('eta') }}: {{ formatTime(chapterInfo.activeJob.estimatedSecondsRemaining) }} + {{ t('eta') }}: {{ formatTime(chapterInfo?.activeJob?.estimatedSecondsRemaining || 0) }}
} @@ -74,7 +74,7 @@
{{ t('listen') }}
} - @if (!loading && !error && chapterInfo?.hasNarration && !chapterInfo.isGenerating) { + @if (!loading && !error && chapterInfo?.hasNarration && !chapterInfo?.isGenerating) {
@@ -145,6 +145,19 @@
{{ t('listen') }}
+ +
+ + +
+