chore: scrobble

This commit is contained in:
Cory Dransfeldt 2024-03-29 16:46:00 -07:00
parent 14706f4217
commit f140ce22fe

View file

@ -15,6 +15,11 @@ const weekStop = () => {
const filterOldScrobbles = (scrobbles) => {
const twoWeeksAgo = DateTime.now().minus({ weeks: 2 });
console.log(scrobbles)
console.log(scrobbles.filter(scrobble => {
const timestamp = DateTime.fromISO(scrobble.timestamp);
return timestamp >= twoWeeksAgo;
}))
return scrobbles.filter(scrobble => {
const timestamp = DateTime.fromISO(scrobble.timestamp);
return timestamp >= twoWeeksAgo;