From d22827bc9badb2c56d0c6d40d0da2202ace82e94 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Sun, 4 Jan 2026 14:31:55 +0100 Subject: [PATCH] feat: add toggle to hide streamystats watchlist tab/functions --- .../settings/plugins/streamystats/page.tsx | 17 +++++++++++++++++ app/(auth)/(tabs)/_layout.tsx | 3 ++- components/ItemContent.tsx | 12 ++++++++++-- translations/en.json | 1 + utils/atoms/settings.ts | 2 ++ 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/app/(auth)/(tabs)/(home)/settings/plugins/streamystats/page.tsx b/app/(auth)/(tabs)/(home)/settings/plugins/streamystats/page.tsx index 3cd4b11f..6b8fc86c 100644 --- a/app/(auth)/(tabs)/(home)/settings/plugins/streamystats/page.tsx +++ b/app/(auth)/(tabs)/(home)/settings/plugins/streamystats/page.tsx @@ -44,6 +44,9 @@ export default function page() { const [promotedWatchlists, setPromotedWatchlists] = useState( settings?.streamyStatsPromotedWatchlists ?? false, ); + const [hideWatchlistsTab, setHideWatchlistsTab] = useState( + settings?.hideWatchlistsTab ?? false, + ); const isUrlLocked = pluginSettings?.streamyStatsServerUrl?.locked === true; const isStreamystatsEnabled = !!url; @@ -56,6 +59,7 @@ export default function page() { streamyStatsMovieRecommendations: movieRecs, streamyStatsSeriesRecommendations: seriesRecs, streamyStatsPromotedWatchlists: promotedWatchlists, + hideWatchlistsTab: hideWatchlistsTab, }); queryClient.invalidateQueries({ queryKey: ["search"] }); queryClient.invalidateQueries({ queryKey: ["streamystats"] }); @@ -66,6 +70,7 @@ export default function page() { movieRecs, seriesRecs, promotedWatchlists, + hideWatchlistsTab, updateSettings, queryClient, t, @@ -90,12 +95,14 @@ export default function page() { setMovieRecs(false); setSeriesRecs(false); setPromotedWatchlists(false); + setHideWatchlistsTab(false); updateSettings({ streamyStatsServerUrl: "", searchEngine: "Jellyfin", streamyStatsMovieRecommendations: false, streamyStatsSeriesRecommendations: false, streamyStatsPromotedWatchlists: false, + hideWatchlistsTab: false, }); queryClient.invalidateQueries({ queryKey: ["streamystats"] }); queryClient.invalidateQueries({ queryKey: ["search"] }); @@ -214,6 +221,16 @@ export default function page() { disabled={!isStreamystatsEnabled} /> + + + {t("home.settings.plugins.streamystats.home_sections_hint")} diff --git a/app/(auth)/(tabs)/_layout.tsx b/app/(auth)/(tabs)/_layout.tsx index ac184d6f..25ebdf35 100644 --- a/app/(auth)/(tabs)/_layout.tsx +++ b/app/(auth)/(tabs)/_layout.tsx @@ -106,7 +106,8 @@ export default function TabLayout() { name='(watchlists)' options={{ title: t("watchlists.title"), - tabBarItemHidden: !settings?.streamyStatsServerUrl, + tabBarItemHidden: + !settings?.streamyStatsServerUrl || settings?.hideWatchlistsTab, tabBarIcon: Platform.OS === "android" ? (_e) => require("@/assets/icons/list.png") diff --git a/components/ItemContent.tsx b/components/ItemContent.tsx index 5fe9da58..9e9592f5 100644 --- a/components/ItemContent.tsx +++ b/components/ItemContent.tsx @@ -123,7 +123,10 @@ export const ItemContent: React.FC = React.memo( - + {settings.streamyStatsServerUrl && + !settings.hideWatchlistsTab && ( + + )} )} @@ -142,7 +145,10 @@ export const ItemContent: React.FC = React.memo( - + {settings.streamyStatsServerUrl && + !settings.hideWatchlistsTab && ( + + )} )} @@ -155,6 +161,8 @@ export const ItemContent: React.FC = React.memo( user, itemWithSources, settings.hideRemoteSessionButton, + settings.streamyStatsServerUrl, + settings.hideWatchlistsTab, ]); useEffect(() => { diff --git a/translations/en.json b/translations/en.json index a45fc60b..bdcea73c 100644 --- a/translations/en.json +++ b/translations/en.json @@ -286,6 +286,7 @@ "enable_movie_recommendations": "Movie Recommendations", "enable_series_recommendations": "Series Recommendations", "enable_promoted_watchlists": "Promoted Watchlists", + "hide_watchlists_tab": "Hide Watchlists Tab", "home_sections_hint": "Show personalized recommendations and promoted watchlists from Streamystats on the home page.", "recommended_movies": "Recommended Movies", "recommended_series": "Recommended Series", diff --git a/utils/atoms/settings.ts b/utils/atoms/settings.ts index f5470f60..4719a99a 100644 --- a/utils/atoms/settings.ts +++ b/utils/atoms/settings.ts @@ -202,6 +202,7 @@ export type Settings = { videoPlayerIOS: VideoPlayerIOS; // Appearance hideRemoteSessionButton: boolean; + hideWatchlistsTab: boolean; // Audio look-ahead caching audioLookaheadEnabled: boolean; audioLookaheadCount: number; @@ -290,6 +291,7 @@ export const defaultValues: Settings = { videoPlayerIOS: VideoPlayerIOS.VLC, // Appearance hideRemoteSessionButton: false, + hideWatchlistsTab: false, // Audio look-ahead caching defaults audioLookaheadEnabled: true, audioLookaheadCount: 2,