diff --git a/components/stats/FollowerGrowth.vue b/components/stats/FollowerGrowth.vue index c112f93..790e894 100644 --- a/components/stats/FollowerGrowth.vue +++ b/components/stats/FollowerGrowth.vue @@ -56,7 +56,7 @@ const { pending, error, data, refresh } = await useLazyAsyncData( async () => { const snapshots = ( await $fetch( - `/api/playlists/${playlistId}/snapshots?sinceDate=${sinceDate.value}` + `/api/playlists/${playlistId}/snapshots?sinceDate=${sinceDate.value}&allowDuplicates=yes` ) ).reverse(); diff --git a/server/api/playlists/[playlistId]/snapshots.ts b/server/api/playlists/[playlistId]/snapshots.ts index 40d1bb6..edc3539 100644 --- a/server/api/playlists/[playlistId]/snapshots.ts +++ b/server/api/playlists/[playlistId]/snapshots.ts @@ -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.