Revert "Persist dashboard periods and explore genre filters in URL via nuqs"

This reverts commit 2bb5af042b.
This commit is contained in:
2026-03-08 15:14:03 -04:00
parent 2bb5af042b
commit 5fdc7ebd97
12 changed files with 70 additions and 213 deletions
+7 -11
View File
@@ -144,19 +144,15 @@ export function getWatchHistory(
}
export interface DashboardStats {
movieCount: number;
episodeCount: number;
moviesThisMonth: number;
episodesThisWeek: number;
librarySize: number;
completed: number;
}
export function getUserStats(
userId: string,
moviePeriod: TimePeriod = "this_month",
episodePeriod: TimePeriod = "this_week",
): DashboardStats {
const movieCount = getWatchCount(userId, "movies", moviePeriod);
const episodeCount = getWatchCount(userId, "episodes", episodePeriod);
export function getUserStats(userId: string): DashboardStats {
const moviesThisMonth = getWatchCount(userId, "movies", "this_month");
const episodesThisWeek = getWatchCount(userId, "episodes", "this_week");
const [statusCounts] = db
.select({
@@ -168,8 +164,8 @@ export function getUserStats(
.all();
return {
movieCount,
episodeCount,
moviesThisMonth,
episodesThisWeek,
librarySize: statusCounts?.librarySize ?? 0,
completed: statusCounts?.completed ?? 0,
};