diff --git a/Grayjay.ClientServer/Settings/GrayjaySettings.cs b/Grayjay.ClientServer/Settings/GrayjaySettings.cs index a14606e..666d9a1 100644 --- a/Grayjay.ClientServer/Settings/GrayjaySettings.cs +++ b/Grayjay.ClientServer/Settings/GrayjaySettings.cs @@ -30,6 +30,12 @@ public class HomeSettings //[SettingsField("Preview Feed Items", SettingsField.TOGGLE, "When the preview feedstyle is used, if items should auto-preview when scrolling over them", 6)] //public bool PreviewFeedItems { get; set; } = true; + [SettingsField("Recommendations on home", SettingsField.TOGGLE, "Show recommendations on home page", 1)] + public bool RecommendationsHomepage { get; set; } = true; + + [SettingsField("Recommendations on videos", SettingsField.TOGGLE, "Show recommendations beside videos", 1)] + public bool ShowRecommendations { get; set; } = true; + [SettingsField("Progress Bar", SettingsField.TOGGLE, "If a historical progress bar should be shown", 7)] public bool ProgressBar { get; set; } = true; diff --git a/Grayjay.Desktop.Web/src/components/contentDetails/VideoDetailView/index.tsx b/Grayjay.Desktop.Web/src/components/contentDetails/VideoDetailView/index.tsx index 041f9c0..dc3987f 100644 --- a/Grayjay.Desktop.Web/src/components/contentDetails/VideoDetailView/index.tsx +++ b/Grayjay.Desktop.Web/src/components/contentDetails/VideoDetailView/index.tsx @@ -153,6 +153,7 @@ const VideoDetailView: Component = (props) => { const [recomPager$] = createResource>(() => videoLoaded$(), async (videoLoaded: any) => { if(!videoLoaded) return undefined; + showRecommendations=(await SettingsBackend.settings())?.object?.home?.showRecommendations; const result = await DetailsBackend.recommendationsPager(videoLoaded.url); console.log("Recommendation Results:", result); return result; @@ -535,7 +536,8 @@ const VideoDetailView: Component = (props) => { }); const videoLoadedIsValid$ = createMemo(() => videoLoaded$()?.url === currentVideo$()?.url); - const recommendationsVisible$ = createMemo(() => videoLoadedIsValid$() && recomPager$.state == "ready" && recomPager$()?.data && recomPager$()?.data.length); + let showRecommendations=false; + const recommendationsVisible$ = createMemo(() => videoLoadedIsValid$() && recomPager$.state == "ready" && recomPager$()?.data && recomPager$()?.data.length && showRecommendations); const shouldHideSideBar = createMemo(() => { //TODO: Expand these conditions const sideBarVisible = shouldShowQueue() || liveChatWindow$() || recommendationsVisible$(); diff --git a/Grayjay.Desktop.Web/src/components/menus/SideBar/index.tsx b/Grayjay.Desktop.Web/src/components/menus/SideBar/index.tsx index c33b2da..de11a7e 100644 --- a/Grayjay.Desktop.Web/src/components/menus/SideBar/index.tsx +++ b/Grayjay.Desktop.Web/src/components/menus/SideBar/index.tsx @@ -83,7 +83,8 @@ const SideBar: Component = (props: SideBarProps) => { action?: () => void, onRightClick?: () => void }> = [ - { icon: home, name: 'Home', path: '/web/home', selected: location.pathname === '/web/home' || location.pathname === '/web/index.html' }, + { icon: home, name: 'Home', path: '/web/home', selected: location.pathname === '/web/home' || location.pathname === '/web/index.html' }, + { icon: home, name: 'Recommended', path: '/web/recommended', selected: location.pathname === '/web/recommended'}, { icon: subscriptions, name: 'Subscriptions', path: '/web/subscriptions', selected: location.pathname === '/web/subscriptions' }, { icon: creators, name: 'Creators', path: '/web/creators', selected: location.pathname === '/web/creators' }, { icon: playlists, name: 'Playlists', path: '/web/playlists', selected: location.pathname === '/web/playlists' }, diff --git a/Grayjay.Desktop.Web/src/index.tsx b/Grayjay.Desktop.Web/src/index.tsx index 86f41b7..166c820 100644 --- a/Grayjay.Desktop.Web/src/index.tsx +++ b/Grayjay.Desktop.Web/src/index.tsx @@ -29,6 +29,7 @@ import GlobalContextMenu from './components/GlobalContextMenu'; import BuyPage from './pages/BuyPage'; import UIOverlay from './state/UIOverlay'; import ExceptionModel from './backend/exceptions/ExceptionModel'; +import { SettingsBackend } from './backend/SettingsBackend'; const HomePage = lazy(() => import('./pages/Home')); const SubscriptionsPage = lazy(() => import('./pages/Subscriptions')); @@ -147,11 +148,14 @@ const App: Component = (props) => { }; +const DefaultPage=(await SettingsBackend.settings())?.object?.home?.recommendationsHomepage? HomePage: SubscriptionsPage; + render(() => ( - - - + + + +