From 5529a7110ffab138867f34f1f14a740d97781bd8 Mon Sep 17 00:00:00 2001 From: Shiva Sai K <129726163+shiva-sai-824@users.noreply.github.com> Date: Sun, 4 Jan 2026 19:42:40 +0530 Subject: [PATCH] Update ui/src/app/app.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ui/src/app/app.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/src/app/app.ts b/ui/src/app/app.ts index 38a39aa..e4f4cc9 100644 --- a/ui/src/app/app.ts +++ b/ui/src/app/app.ts @@ -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);