Skip to content

fix: make CapturedRange start/end date filters inclusive - #27

Merged
himewel merged 1 commit into
mainfrom
cursor/inclusive-captured-range-904c
Aug 12, 2026
Merged

fix: make CapturedRange start/end date filters inclusive#27
himewel merged 1 commit into
mainfrom
cursor/inclusive-captured-range-904c

Conversation

@himewel

@himewel himewel commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

Same-day captured_range filters (e.g. start=2024-01-07, end=2024-01-07) were serialized as identical midnights (…T00:00:00.000Z,…T00:00:00.000Z). The GoPro cloud API treats that window as half-open [start, end), so the result was an empty media array.

Changes

  • In CapturedRange._serialize_captured_range, use the calendar date portion only (also fixes a double-T bug when the datetime already had a time).
  • Advance the serialized end by one day so the caller's end date is inclusive.
  • Align docs/examples with inclusive calendar-day semantics (--start 2026-03-01 --end 2026-03-01 for a single day).

Example

CapturedRange(
    start=datetime.fromisoformat("2024-01-07"),
    end=datetime.fromisoformat("2024-01-07"),
).model_dump()
# -> "2024-01-07T00:00:00.000Z,2024-01-08T00:00:00.000Z"
Open in Web Open in Cursor 

Serialize calendar dates only and advance the exclusive API end bound by
one day so same-day filters (e.g. 07–07) cover the full day instead of
collapsing to an empty midnight-to-midnight window.

Co-authored-by: Welbert Castro <welberthime@gmail.com>
@github-actions github-actions Bot added the fix label Aug 12, 2026
@himewel
himewel marked this pull request as ready for review August 12, 2026 01:20
@himewel
himewel merged commit 31f2242 into main Aug 12, 2026
5 checks passed
@himewel
himewel deleted the cursor/inclusive-captured-range-904c branch August 12, 2026 01:22
@himewel himewel mentioned this pull request Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants