(null);
const [confirmDeleteOpen, setConfirmDeleteOpen] = useState(false);
@@ -147,6 +149,7 @@ export function MovieModal({ movieId, onClose }: MovieModalProps) {
if (!progress) return;
setSelectedStatus(ENUM_TO_STATUS[progress.status] ?? "");
+ setRewatchCount(progress.watchCount != null ? String(progress.watchCount) : "");
}, [progressQuery.data]);
useEffect(() => {
@@ -171,10 +174,11 @@ export function MovieModal({ movieId, onClose }: MovieModalProps) {
};
const saveProgressMutation = useMutation({
- mutationFn: (status: string) =>
+ mutationFn: (data: { status: string; watchCount?: number }) =>
api.post(apiEndpoints.movieProgress, {
movieId,
- status: STATUS_TO_ENUM[status],
+ status: STATUS_TO_ENUM[data.status],
+ watchCount: data.watchCount,
}),
onSuccess: invalidateProgress,
});
@@ -263,7 +267,10 @@ export function MovieModal({ movieId, onClose }: MovieModalProps) {
}
try {
- await saveProgressMutation.mutateAsync(selectedStatus);
+ await saveProgressMutation.mutateAsync({
+ status: selectedStatus,
+ watchCount: rewatchCount ? Number(rewatchCount) : undefined,
+ });
const review = reviewForm.getValues();
@@ -309,6 +316,24 @@ export function MovieModal({ movieId, onClose }: MovieModalProps) {
+
+
+
+ {t("feed:totalRewatches")}
+
+ setRewatchCount(e.target.value)}
+ aria-label={t("feed:totalRewatches")}
+ />
+
diff --git a/src/hooks/game.ts b/src/hooks/game.ts
index eaeca23..fec43b4 100644
--- a/src/hooks/game.ts
+++ b/src/hooks/game.ts
@@ -2,7 +2,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
import { api, apiEndpoints } from "@/lib/api.ts";
interface GameProgress {
- progress: number;
+ hoursPlayed: number;
status: string | null;
completionStatus: string | null;
replays: number;
diff --git a/src/hooks/progress.ts b/src/hooks/progress.ts
index 362172b..621c79f 100644
--- a/src/hooks/progress.ts
+++ b/src/hooks/progress.ts
@@ -2,7 +2,7 @@ import { useInfiniteQuery } from "@tanstack/react-query";
import type { FavoriteItem } from "@/components/pages/user/overview-tab/favorite-card";
import { type ApiTypes, api, apiEndpoints } from "@/lib/api.ts";
-const ITEMS_PER_PAGE = 18;
+const ITEMS_PER_PAGE = 200;
type ProgressStatsKey = keyof ApiTypes.User["progressStats"];
diff --git a/src/lib/i18n/locales/en-US/feed.json b/src/lib/i18n/locales/en-US/feed.json
index f8861ab..f4a8cfd 100644
--- a/src/lib/i18n/locales/en-US/feed.json
+++ b/src/lib/i18n/locales/en-US/feed.json
@@ -91,6 +91,7 @@
},
"totalRereads": "Total Rereads",
"totalReplays": "Total Replays",
+ "hoursPlayed": "Hours Played",
"completionStatus": {
"label": "Completion Status",
"select": "Select a completion status",