fix: tautulli get_history use after=unix_ts not start_date

This commit is contained in:
2026-04-23 11:08:08 -04:00
parent 1016fd397e
commit 29f3201fc5
+2 -1
View File
@@ -28,12 +28,13 @@ export async function backfillUserHistory(user: {
d.setDate(d.getDate() - 30); d.setDate(d.getDate() - 30);
return d.toISOString().split("T")[0]; return d.toISOString().split("T")[0];
})(); })();
const afterTimestamp = Math.floor(new Date(startDate).getTime() / 1000);
const historyResponse = await axios.get(`${TAUTULLI_URL}/api/v2`, { const historyResponse = await axios.get(`${TAUTULLI_URL}/api/v2`, {
params: { params: {
apikey: TAUTULLI_API_KEY, apikey: TAUTULLI_API_KEY,
cmd: "get_history", cmd: "get_history",
user_id: tautulliUser.user_id, user_id: tautulliUser.user_id,
start_date: startDate, after: afterTimestamp,
length: 1000, length: 1000,
}, },
}); });