Gets when a track was last logged
Retrieves the timestamp when a specific track was last logged or processed. Returns 0 if the track has never been logged.
Spotify track ID to check
Millisecond timestamp when the track was last logged, or 0 if never logged
// Check if we've recently logged a trackconst lastLogged = getTrackLastLogged('spotify:track:1234567890');const fiveMinutesAgo = Date.now() - (5 * 60 * 1000);if (lastLogged > fiveMinutesAgo) { console.log('Track was logged less than 5 minutes ago');} Copy
// Check if we've recently logged a trackconst lastLogged = getTrackLastLogged('spotify:track:1234567890');const fiveMinutesAgo = Date.now() - (5 * 60 * 1000);if (lastLogged > fiveMinutesAgo) { console.log('Track was logged less than 5 minutes ago');}
export function getTrackLastLogged(trackId: string): number { return trackLastLogged[trackId] || 0;} Copy
export function getTrackLastLogged(trackId: string): number { return trackLastLogged[trackId] || 0;}
Gets when a track was last logged
Retrieves the timestamp when a specific track was last logged or processed. Returns 0 if the track has never been logged.