fix: tautulli get_history use after=unix_ts not start_date
This commit is contained in:
@@ -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,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user