From 200d3e69ac5f17c55415cec7ea53a5a96953a22a Mon Sep 17 00:00:00 2001
From: Pas <74743263+Pasithea0@users.noreply.github.com>
Date: Tue, 24 Jun 2025 17:59:13 -0600
Subject: [PATCH] add low performance mode
---
src/assets/locales/en.json | 5 +-
src/backend/accounts/settings.ts | 2 +
src/components/LinksDropdown.tsx | 13 ++-
src/components/layout/Navigation.tsx | 62 +++++++------
src/components/media/MediaCard.tsx | 6 +-
.../player/internals/InfoButton.tsx | 9 ++
src/components/utils/Lightbar.tsx | 4 +-
src/hooks/auth/useAuthData.ts | 9 ++
src/hooks/useLowPerformanceMode.ts | 16 ++++
src/hooks/useSettingsState.ts | 16 +++-
src/pages/HomePage.tsx | 10 ++-
src/pages/Settings.tsx | 17 +++-
src/pages/parts/settings/AppearancePart.tsx | 67 +++++++++++---
src/pages/parts/settings/PreferencesPart.tsx | 88 ++++++++++++++-----
src/setup/App.tsx | 2 +
src/stores/preferences/index.tsx | 8 ++
16 files changed, 261 insertions(+), 73 deletions(-)
create mode 100644 src/hooks/useLowPerformanceMode.ts
diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json
index 5548ccfa..5a7f6ba6 100644
--- a/src/assets/locales/en.json
+++ b/src/assets/locales/en.json
@@ -961,6 +961,7 @@
}
},
"preferences": {
+ "title": "Preferences",
"language": "Application language",
"languageDescription": "Language applied to the entire application, only English has silly stuff 🙁.",
"thumbnail": "Generate thumbnails",
@@ -972,9 +973,11 @@
"skipCredits": "Skip End Credits",
"skipCreditsDescription": "When enabled, automatically play the next episode at 99% completion to skip end credits. When disabled, wait until the episode is fully completed.",
"skipCreditsLabel": "Skip end credits",
+ "lowPerformanceMode": "Low performance/bandwidth mode",
+ "lowPerformanceModeDescription": "Optimizes the application for slower connections and devices by disabling bandwidth-heavy features. This mode reduces data usage and improves performance while keeping the core search and watch functionality intact. ",
+ "lowPerformanceModeLabel": "Low performance mode",
"sourceOrder": "Reordering sources",
"sourceOrderDescription": "Drag and drop to reorder sources. This will determine the order in which sources are checked for the media you are trying to watch. If a source is greyed out, it means the extension is required for that source.
(The default order is best for most users)",
- "title": "Preferences",
"sourceOrderEnableLabel": "Custom source order"
},
"reset": "Reset",
diff --git a/src/backend/accounts/settings.ts b/src/backend/accounts/settings.ts
index dc747e62..86f6af2a 100644
--- a/src/backend/accounts/settings.ts
+++ b/src/backend/accounts/settings.ts
@@ -22,6 +22,7 @@ export interface SettingsInput {
sourceOrder?: string[];
enableSourceOrder?: boolean;
proxyTmdb?: boolean;
+ enableLowPerformanceMode?: boolean;
}
export interface SettingsResponse {
@@ -42,6 +43,7 @@ export interface SettingsResponse {
sourceOrder?: string[];
enableSourceOrder?: boolean;
proxyTmdb?: boolean;
+ enableLowPerformanceMode?: boolean;
}
export function updateSettings(
diff --git a/src/components/LinksDropdown.tsx b/src/components/LinksDropdown.tsx
index 43e88d71..5b1329d6 100644
--- a/src/components/LinksDropdown.tsx
+++ b/src/components/LinksDropdown.tsx
@@ -13,6 +13,7 @@ import { useAuth } from "@/hooks/auth/useAuth";
import { useBackendUrl } from "@/hooks/auth/useBackendUrl";
import { conf } from "@/setup/config";
import { useAuthStore } from "@/stores/auth";
+import { usePreferencesStore } from "@/stores/preferences";
function Divider() {
return