mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-19 10:44:18 +01:00
feat: add toggle to hide streamystats watchlist tab/functions
This commit is contained in:
@@ -44,6 +44,9 @@ export default function page() {
|
|||||||
const [promotedWatchlists, setPromotedWatchlists] = useState<boolean>(
|
const [promotedWatchlists, setPromotedWatchlists] = useState<boolean>(
|
||||||
settings?.streamyStatsPromotedWatchlists ?? false,
|
settings?.streamyStatsPromotedWatchlists ?? false,
|
||||||
);
|
);
|
||||||
|
const [hideWatchlistsTab, setHideWatchlistsTab] = useState<boolean>(
|
||||||
|
settings?.hideWatchlistsTab ?? false,
|
||||||
|
);
|
||||||
|
|
||||||
const isUrlLocked = pluginSettings?.streamyStatsServerUrl?.locked === true;
|
const isUrlLocked = pluginSettings?.streamyStatsServerUrl?.locked === true;
|
||||||
const isStreamystatsEnabled = !!url;
|
const isStreamystatsEnabled = !!url;
|
||||||
@@ -56,6 +59,7 @@ export default function page() {
|
|||||||
streamyStatsMovieRecommendations: movieRecs,
|
streamyStatsMovieRecommendations: movieRecs,
|
||||||
streamyStatsSeriesRecommendations: seriesRecs,
|
streamyStatsSeriesRecommendations: seriesRecs,
|
||||||
streamyStatsPromotedWatchlists: promotedWatchlists,
|
streamyStatsPromotedWatchlists: promotedWatchlists,
|
||||||
|
hideWatchlistsTab: hideWatchlistsTab,
|
||||||
});
|
});
|
||||||
queryClient.invalidateQueries({ queryKey: ["search"] });
|
queryClient.invalidateQueries({ queryKey: ["search"] });
|
||||||
queryClient.invalidateQueries({ queryKey: ["streamystats"] });
|
queryClient.invalidateQueries({ queryKey: ["streamystats"] });
|
||||||
@@ -66,6 +70,7 @@ export default function page() {
|
|||||||
movieRecs,
|
movieRecs,
|
||||||
seriesRecs,
|
seriesRecs,
|
||||||
promotedWatchlists,
|
promotedWatchlists,
|
||||||
|
hideWatchlistsTab,
|
||||||
updateSettings,
|
updateSettings,
|
||||||
queryClient,
|
queryClient,
|
||||||
t,
|
t,
|
||||||
@@ -90,12 +95,14 @@ export default function page() {
|
|||||||
setMovieRecs(false);
|
setMovieRecs(false);
|
||||||
setSeriesRecs(false);
|
setSeriesRecs(false);
|
||||||
setPromotedWatchlists(false);
|
setPromotedWatchlists(false);
|
||||||
|
setHideWatchlistsTab(false);
|
||||||
updateSettings({
|
updateSettings({
|
||||||
streamyStatsServerUrl: "",
|
streamyStatsServerUrl: "",
|
||||||
searchEngine: "Jellyfin",
|
searchEngine: "Jellyfin",
|
||||||
streamyStatsMovieRecommendations: false,
|
streamyStatsMovieRecommendations: false,
|
||||||
streamyStatsSeriesRecommendations: false,
|
streamyStatsSeriesRecommendations: false,
|
||||||
streamyStatsPromotedWatchlists: false,
|
streamyStatsPromotedWatchlists: false,
|
||||||
|
hideWatchlistsTab: false,
|
||||||
});
|
});
|
||||||
queryClient.invalidateQueries({ queryKey: ["streamystats"] });
|
queryClient.invalidateQueries({ queryKey: ["streamystats"] });
|
||||||
queryClient.invalidateQueries({ queryKey: ["search"] });
|
queryClient.invalidateQueries({ queryKey: ["search"] });
|
||||||
@@ -214,6 +221,16 @@ export default function page() {
|
|||||||
disabled={!isStreamystatsEnabled}
|
disabled={!isStreamystatsEnabled}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
<ListItem
|
||||||
|
title={t("home.settings.plugins.streamystats.hide_watchlists_tab")}
|
||||||
|
disabledByAdmin={pluginSettings?.hideWatchlistsTab?.locked === true}
|
||||||
|
>
|
||||||
|
<Switch
|
||||||
|
value={hideWatchlistsTab}
|
||||||
|
onValueChange={setHideWatchlistsTab}
|
||||||
|
disabled={!isStreamystatsEnabled}
|
||||||
|
/>
|
||||||
|
</ListItem>
|
||||||
</ListGroup>
|
</ListGroup>
|
||||||
<Text className='px-4 text-xs text-neutral-500 mt-1'>
|
<Text className='px-4 text-xs text-neutral-500 mt-1'>
|
||||||
{t("home.settings.plugins.streamystats.home_sections_hint")}
|
{t("home.settings.plugins.streamystats.home_sections_hint")}
|
||||||
|
|||||||
@@ -106,7 +106,8 @@ export default function TabLayout() {
|
|||||||
name='(watchlists)'
|
name='(watchlists)'
|
||||||
options={{
|
options={{
|
||||||
title: t("watchlists.title"),
|
title: t("watchlists.title"),
|
||||||
tabBarItemHidden: !settings?.streamyStatsServerUrl,
|
tabBarItemHidden:
|
||||||
|
!settings?.streamyStatsServerUrl || settings?.hideWatchlistsTab,
|
||||||
tabBarIcon:
|
tabBarIcon:
|
||||||
Platform.OS === "android"
|
Platform.OS === "android"
|
||||||
? (_e) => require("@/assets/icons/list.png")
|
? (_e) => require("@/assets/icons/list.png")
|
||||||
|
|||||||
@@ -123,7 +123,10 @@ export const ItemContent: React.FC<ItemContentProps> = React.memo(
|
|||||||
|
|
||||||
<PlayedStatus items={[item]} size='large' />
|
<PlayedStatus items={[item]} size='large' />
|
||||||
<AddToFavorites item={item} />
|
<AddToFavorites item={item} />
|
||||||
<AddToWatchlist item={item} />
|
{settings.streamyStatsServerUrl &&
|
||||||
|
!settings.hideWatchlistsTab && (
|
||||||
|
<AddToWatchlist item={item} />
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
@@ -142,7 +145,10 @@ export const ItemContent: React.FC<ItemContentProps> = React.memo(
|
|||||||
|
|
||||||
<PlayedStatus items={[item]} size='large' />
|
<PlayedStatus items={[item]} size='large' />
|
||||||
<AddToFavorites item={item} />
|
<AddToFavorites item={item} />
|
||||||
<AddToWatchlist item={item} />
|
{settings.streamyStatsServerUrl &&
|
||||||
|
!settings.hideWatchlistsTab && (
|
||||||
|
<AddToWatchlist item={item} />
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
@@ -155,6 +161,8 @@ export const ItemContent: React.FC<ItemContentProps> = React.memo(
|
|||||||
user,
|
user,
|
||||||
itemWithSources,
|
itemWithSources,
|
||||||
settings.hideRemoteSessionButton,
|
settings.hideRemoteSessionButton,
|
||||||
|
settings.streamyStatsServerUrl,
|
||||||
|
settings.hideWatchlistsTab,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -286,6 +286,7 @@
|
|||||||
"enable_movie_recommendations": "Movie Recommendations",
|
"enable_movie_recommendations": "Movie Recommendations",
|
||||||
"enable_series_recommendations": "Series Recommendations",
|
"enable_series_recommendations": "Series Recommendations",
|
||||||
"enable_promoted_watchlists": "Promoted Watchlists",
|
"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.",
|
"home_sections_hint": "Show personalized recommendations and promoted watchlists from Streamystats on the home page.",
|
||||||
"recommended_movies": "Recommended Movies",
|
"recommended_movies": "Recommended Movies",
|
||||||
"recommended_series": "Recommended Series",
|
"recommended_series": "Recommended Series",
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ export type Settings = {
|
|||||||
videoPlayerIOS: VideoPlayerIOS;
|
videoPlayerIOS: VideoPlayerIOS;
|
||||||
// Appearance
|
// Appearance
|
||||||
hideRemoteSessionButton: boolean;
|
hideRemoteSessionButton: boolean;
|
||||||
|
hideWatchlistsTab: boolean;
|
||||||
// Audio look-ahead caching
|
// Audio look-ahead caching
|
||||||
audioLookaheadEnabled: boolean;
|
audioLookaheadEnabled: boolean;
|
||||||
audioLookaheadCount: number;
|
audioLookaheadCount: number;
|
||||||
@@ -290,6 +291,7 @@ export const defaultValues: Settings = {
|
|||||||
videoPlayerIOS: VideoPlayerIOS.VLC,
|
videoPlayerIOS: VideoPlayerIOS.VLC,
|
||||||
// Appearance
|
// Appearance
|
||||||
hideRemoteSessionButton: false,
|
hideRemoteSessionButton: false,
|
||||||
|
hideWatchlistsTab: false,
|
||||||
// Audio look-ahead caching defaults
|
// Audio look-ahead caching defaults
|
||||||
audioLookaheadEnabled: true,
|
audioLookaheadEnabled: true,
|
||||||
audioLookaheadCount: 2,
|
audioLookaheadCount: 2,
|
||||||
|
|||||||
Reference in New Issue
Block a user