diff --git a/apps/frontend/app/routes/_dashboard._index.tsx b/apps/frontend/app/routes/_dashboard._index.tsx index 7366f29cad..8b8de96f02 100644 --- a/apps/frontend/app/routes/_dashboard._index.tsx +++ b/apps/frontend/app/routes/_dashboard._index.tsx @@ -24,7 +24,11 @@ import { UserUpcomingCalendarEventsDocument, } from "@ryot/generated/graphql/backend/graphql"; import { isNumber } from "@ryot/ts-utils"; -import { IconInfoCircle, IconRotateClockwise } from "@tabler/icons-react"; +import { + IconBackpack, + IconInfoCircle, + IconRotateClockwise, +} from "@tabler/icons-react"; import CryptoJS from "crypto-js"; import type { ReactNode } from "react"; import { ClientOnly } from "remix-utils/client-only"; @@ -135,6 +139,13 @@ export default function Page() { "false", ); + const isDashboardEmpty = + loaderData.userUpcomingCalendarEvents.length + + loaderData.inProgressCollectionContents.results.items.length + + loaderData.userRecommendations.length + + Number(Boolean(latestUserSummary)) === + 0; + return ( @@ -152,6 +163,13 @@ export default function Page() { ) : null } + {isDashboardEmpty ? ( + }> + Start by marking a few movies as watched by: clicking on the Media + section in the sidebar, selecting Movie, opening the search tab and + then typing your favorite movie! + + ) : null} {userPreferences.general.dashboard.map((de) => match([de.section, de.hidden]) .with([DashboardElementLot.Upcoming, false], ([v, _]) => @@ -185,39 +203,41 @@ export default function Page() { ) : null, ) - .with([DashboardElementLot.Recommendations, false], ([v, _]) => ( -
- - - { - openConfirmationModal( - "Are you sure you want to refresh the recommendations?", - async () => { - await clientGqlService.request( - UserMetadataRecommendationsDocument, - { shouldRefresh: true }, - ); - revalidator.revalidate(); - }, - ); - }} - > - - - - {coreDetails.isServerKeyValidated ? ( - - {loaderData.userRecommendations.map((lm) => ( - - ))} - - ) : ( - - )} -
- )) + .with([DashboardElementLot.Recommendations, false], ([v, _]) => + loaderData.userRecommendations.length > 0 ? ( +
+ + + { + openConfirmationModal( + "Are you sure you want to refresh the recommendations?", + async () => { + await clientGqlService.request( + UserMetadataRecommendationsDocument, + { shouldRefresh: true }, + ); + revalidator.revalidate(); + }, + ); + }} + > + + + + {coreDetails.isServerKeyValidated ? ( + + {loaderData.userRecommendations.map((lm) => ( + + ))} + + ) : ( + + )} +
+ ) : null, + ) .with([DashboardElementLot.Summary, false], ([v, _]) => latestUserSummary ? (
diff --git a/crates/services/user/src/lib.rs b/crates/services/user/src/lib.rs index 37f23d4afa..f7e4f26e50 100644 --- a/crates/services/user/src/lib.rs +++ b/crates/services/user/src/lib.rs @@ -97,10 +97,11 @@ impl UserService { return Ok(Vec::new()); } let mut recommendations = HashSet::new(); - loop { + for i in 0..10 { if recommendations.len() >= limit.try_into().unwrap() { break; } + ryot_log!(debug, "Generating recommendation in loop: {}", i); let selected_lot = enabled.choose(&mut rand::rng()).unwrap(); let rec = Metadata::find() .select_only()