[V1] Created Toaster & Augmented Explore Tab

This commit is contained in:
Youwes09
2026-02-23 11:36:52 -06:00
parent cd2d79f80c
commit 7b61f85833
11 changed files with 704 additions and 137 deletions
+6 -1
View File
@@ -448,7 +448,8 @@ function ExploreFeed({ onDrill }: { onDrill: (d: DrillState) => void }) {
.finally(() => setLoadingPopular(false));
}, []);
// Once library loaded AND sources ready, search each frecency genre across sources
const FOUNDATIONAL_GENRES = ["Action", "Romance", "Fantasy", "Adventure", "Comedy", "Drama", "Sci-fi", "Horror"];
const frecencyGenres = useMemo(() => {
const mangaScores = new Map<number, number>();
const mangaReadAt = new Map<number, number>();
@@ -469,6 +470,10 @@ function ExploreFeed({ onDrill }: { onDrill: (d: DrillState) => void }) {
(m.genre ?? []).forEach((g) =>
genreWeights.set(g, (genreWeights.get(g) ?? 0) + 1)));
}
// If still empty (new user, no library), fall back to foundational genres
if (genreWeights.size === 0) {
return FOUNDATIONAL_GENRES.slice(0, 5);
}
return Array.from(genreWeights.entries())
.sort((a, b) => b[1] - a[1])
.slice(0, 3) // top 3 genres only