diff --git a/backend/src/services/tautulli.ts b/backend/src/services/tautulli.ts index 0cb5c28..ea723a8 100644 --- a/backend/src/services/tautulli.ts +++ b/backend/src/services/tautulli.ts @@ -28,12 +28,13 @@ export async function backfillUserHistory(user: { d.setDate(d.getDate() - 30); return d.toISOString().split("T")[0]; })(); + const afterTimestamp = Math.floor(new Date(startDate).getTime() / 1000); const historyResponse = await axios.get(`${TAUTULLI_URL}/api/v2`, { params: { apikey: TAUTULLI_API_KEY, cmd: "get_history", user_id: tautulliUser.user_id, - start_date: startDate, + after: afterTimestamp, length: 1000, }, });