feat: Implement session deduplication in activity listing
- Added a new query parameter `collapseDuplicateSessions` to the activity listing endpoint to enable deduplication of sessions based on date, type, start time, duration, and calories. - Enhanced backend logic to handle deduplication and return the most recent entry for duplicate sessions. - Updated frontend to support the new deduplication feature, improving the clarity of displayed activity data. - Modified API utility to include the new parameter in requests for activity data.
This commit is contained in:
1 parent
f718785145
commit
c6e8371d5a
4 files changed
+189
-26
No files matched your search
@@ -141,13 +141,14 @@ export const api = {
|
||||
/**
|
||||
* @param {number} [limit=200]
|
||||
* @param {number} [days] nur Einträge ab HEUTE−days (Kalendertage), backend-filtert
|
||||
* @param {{ offset?: number, skipQualityFilter?: boolean, month?: string }} [opts] month = YYYY-MM (schließt days/offset aus)
|
||||
* @param {{ offset?: number, skipQualityFilter?: boolean, month?: string, collapseDuplicateSessions?: boolean }} [opts] month = YYYY-MM (schließt days/offset aus)
|
||||
*/
|
||||
listActivity: (limit=200, days, opts={})=> {
|
||||
const q = new URLSearchParams({ limit: String(limit) })
|
||||
if (days != null && days !== '') q.set('days', String(days))
|
||||
if (opts.month) q.set('month', String(opts.month))
|
||||
if (opts.offset != null && opts.offset > 0) q.set('offset', String(opts.offset))
|
||||
if (opts.collapseDuplicateSessions) q.set('collapse_duplicate_sessions', 'true')
|
||||
if (opts.skipQualityFilter) q.set('skip_quality_filter', 'true')
|
||||
return req(`/activity?${q}`)
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user