Update ui/src/app/app.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Shiva Sai K 2026-01-04 19:42:40 +05:30 committed by GitHub
parent c3b2870250
commit 5529a7110f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,7 +111,13 @@ export class App implements AfterViewInit, OnInit {
// Will be set from backend configuration, use empty string as placeholder
this.chapterTemplate = this.cookieService.get('metube_chapter_template') || '';
this.enableRetryFailed = this.cookieService.get('metube_retry_failed') === 'true';
this.maxRetryAttempts = parseInt(this.cookieService.get('metube_max_retry_attempts') || '3', 10);
const maxRetryCookie = this.cookieService.get('metube_max_retry_attempts');
const parsedMaxRetry = parseInt(maxRetryCookie, 10);
if (isNaN(parsedMaxRetry) || parsedMaxRetry < 1 || parsedMaxRetry > 10) {
this.maxRetryAttempts = 3;
} else {
this.maxRetryAttempts = parsedMaxRetry;
}
this.activeTheme = this.getPreferredTheme(this.cookieService);