Fetches and formats information about the most recently skipped tracks,
including detailed metadata and skip statistics. This function provides
the data needed for "Recently Skipped" UI displays and trend analysis.
The returned data includes:
Track identifiers and basic metadata (name, artist, album)
Timestamp of most recent skip
Skip percentage (how often this track is skipped)
Total skip count for each track
The results are sorted by recency, with the most recently skipped tracks
appearing first. This provides an up-to-date view of listening behavior
and helps identify potential patterns in recently skipped content.
Example
// Display the 5 most recently skipped tracks constrecentSkips = awaitgetRecentSkippedTracks(5); renderRecentSkipsWidget(recentSkips);
// Convert track metrics to array and sort by last played (most recent first) consttracks = Object.entries(statistics.trackMetrics) .map(([id, metrics]) => ({ id, name:metrics.name || "Unknown Track", artist:metrics.artistName || "Unknown Artist", album:"Unknown Album", // We don't have album info in the metrics timestamp:metrics.lastPlayed || newDate().toISOString(), skipPercentage: metrics.skipCount > 0 ? Math.round( (metrics.skipCount / Math.max(metrics.playCount, 1)) * 100, ) : 0, skipCount:metrics.skipCount || 0, })) .filter((track) =>track.skipCount > 0) // Only include tracks that have been skipped .sort( (a, b) => newDate(b.timestamp).getTime() - newDate(a.timestamp).getTime(), ) // Sort by most recent .slice(0, limit); // Take only the specified number of tracks
Retrieves a list of recently skipped tracks
Fetches and formats information about the most recently skipped tracks, including detailed metadata and skip statistics. This function provides the data needed for "Recently Skipped" UI displays and trend analysis.
The returned data includes:
The results are sorted by recency, with the most recently skipped tracks appearing first. This provides an up-to-date view of listening behavior and helps identify potential patterns in recently skipped content.
Example
Source