mirror of
https://github.com/maciejpedzich/spotifyplaylistarchive.com.git
synced 2024-09-19 18:16:19 +02:00
Ensure each day is displayed in the follower chart
This commit is contained in:
parent
6ab8b6e7ef
commit
b7ae383e65
@ -56,7 +56,7 @@ const { pending, error, data, refresh } = await useLazyAsyncData(
|
||||
async () => {
|
||||
const snapshots = (
|
||||
await $fetch<CalendarEntry[]>(
|
||||
`/api/playlists/${playlistId}/snapshots?sinceDate=${sinceDate.value}`
|
||||
`/api/playlists/${playlistId}/snapshots?sinceDate=${sinceDate.value}&allowDuplicates=yes`
|
||||
)
|
||||
).reverse();
|
||||
|
||||
|
@ -50,6 +50,8 @@ export default defineEventHandler(async (event) => {
|
||||
})
|
||||
);
|
||||
|
||||
if (query.allowDuplicates === 'yes') return possiblyDuplicateSnapshotEntries;
|
||||
|
||||
// Since commit listings are sorted by the latest dateCaptured first,
|
||||
// the following will preserve the last item with a duplicate key value.
|
||||
// Therefore, we'll be left with entries containing the earliest dateCaptured.
|
||||
|
Loading…
Reference in New Issue
Block a user