Ensure each day is displayed in the follower chart

This commit is contained in:
Maciej Pędzich 2022-07-24 11:21:43 +02:00
parent 6ab8b6e7ef
commit b7ae383e65
2 changed files with 3 additions and 1 deletions

View File

@ -56,7 +56,7 @@ const { pending, error, data, refresh } = await useLazyAsyncData(
async () => { async () => {
const snapshots = ( const snapshots = (
await $fetch<CalendarEntry[]>( await $fetch<CalendarEntry[]>(
`/api/playlists/${playlistId}/snapshots?sinceDate=${sinceDate.value}` `/api/playlists/${playlistId}/snapshots?sinceDate=${sinceDate.value}&allowDuplicates=yes`
) )
).reverse(); ).reverse();

View File

@ -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, // Since commit listings are sorted by the latest dateCaptured first,
// the following will preserve the last item with a duplicate key value. // the following will preserve the last item with a duplicate key value.
// Therefore, we'll be left with entries containing the earliest dateCaptured. // Therefore, we'll be left with entries containing the earliest dateCaptured.