Skip to content

Add bounded stored-recording metadata listing - #4

Open
megablocks wants to merge 4 commits into
privatecoder:masterfrom
megablocks:feat/file-info-list-recordings
Open

Add bounded stored-recording metadata listing#4
megablocks wants to merge 4 commits into
privatecoder:masterfrom
megablocks:feat/file-info-list-recordings

Conversation

@megablocks

@megablocks megablocks commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • add typed FileInfoList XML models and a bounded core recording-metadata API
  • implement the OPEN (14) / GET (15) / CLOSE (16) cursor lifecycle with a best-effort CLOSE on every completed path after OPEN
  • serialize FileInfoList cursor flows per BcCamera
  • add a neolink recordings CLI for same-day, channel-aware metadata searches
  • redact FileInfoList XML from protocol debug, parse-error, and unmatched-response output
  • document the protocol and user-facing command

This deliberately implements listing only. It does not replay or download recording content.

Safety, compatibility, and behavior

  • validates camera-local dates, same-day ranges, and logical channels 0..=31 in the core API
  • provides a valid bounded RecordingSearchOptions::default
  • re-exports FileDateTime alongside the recording API
  • retains a trimmed non-empty UID supplied through BcCameraOpt and uses it without issuing a UID discovery request
  • when no configured UID is available, resolves the UID for the query channel with a fixed timeout before taking the recording cursor lock
  • keeps the existing configured-channel uid() API and adds explicit-channel get_uid_for_channel() / uid_for_channel() APIs for NVR and multi-channel callers
  • enforces caller limits plus hard page/entry ceilings
  • honors explicit finished=0 even on short pages; uses page-size completion only when the marker is absent
  • accepts top-level or nested cursor handles and top-level or nested completion markers
  • accepts Id, ID, and id, plus structured and plain-text date/time layouts
  • prefers <type>, then <recordType>, then <alarmType>
  • treats a successful generic/empty GET body as an empty page and any successful CLOSE body as an acknowledgement
  • deduplicates repeated entries and detects stalled pagination
  • distinguishes natural completion from page, entry, and stall stops
  • attempts CLOSE after every successfully opened, completed search path; cancellation can interrupt cleanup
  • preserves both search and CLOSE failures in the combined error display, with the search failure as its source
  • keeps the default CLI output filename/path-free
  • emits camera-provided identifiers only with explicit --json; UID, credentials, and raw XML are never emitted
  • sends protocol/debug logging to stderr so JSON stdout remains one document

The command reports fields already present in the FileInfoList response and does not perform separate filename enrichment.

Validation

Validated on ARM64 with Rust/Clippy 1.88.0:

  • cargo +1.88.0 fmt --check
  • cargo +1.88.0 test --no-default-features --workspace — 12 CLI, 108 core, and 2 doc tests passed
  • cargo +1.88.0 clippy --no-default-features --workspace --all-targets -- -A clippy::uninlined-format-args -A clippy::too-many-arguments -D warnings
    • the two narrowly allowed findings are pre-existing and unchanged on the exact upstream base: build.rs format args and UdpSource::new_from_socket argument count
  • cargo +1.88.0 build --no-default-features --workspace
  • cargo +1.88.0 doc --no-default-features --workspace --no-deps
    • succeeds with pre-existing broken-link/bare-URL warnings outside this change
  • CLI help/stdout-stderr smoke test
  • committed private-environment and protocol-stdout source scans

Synthetic regressions cover explicit unfinished short pages, invalid core channels, type precedence, ID aliases, structured/plain timestamps, unmatched-response redaction, generic successful bodies, concurrent cursor serialization, top-level handles, nested completion markers, valid defaults, configured-UID discovery bypass, query-channel UID requests, bounded discovery timeout/error behavior, UID-before-cursor lock ordering, UID trimming, and combined failures.

The protocol flow was also validated read-only against a dual-channel camera over UID relay: both channels paginated independently, an empty date terminated cleanly, and all opened cursors in those completed runs received acknowledged CLOSE commands. No real UID, filenames, credentials, dates, hostnames, or response XML are included in this branch; fixtures are synthetic.

Compatibility

  • based exactly on upstream cd05fc97ea4eac356d99354cae3a43e029100142 (master / 0.7.19)
  • no new dependencies
  • contribution remains under AGPL-3.0

@megablocks
megablocks marked this pull request as ready for review July 31, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant