feat(contentsearch): search exported images and read metadata #2234

Closed
erick-dsnk wants to merge 2 commits from upstream-pr/2234 into main
erick-dsnk commented 2026-10-09 12:37:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by erick-dsnk on 2026-10-09T12:37:35Z.


What

Implement the five pending libSceContentSearch calls for images exported through the host's libSceContentExport catalog. Searches now return actual persisted image rows, apply typed comparisons and homogeneous AND/OR groups, sort and paginate results, and expose metadata handles for title, created time, byte size and decoded dimensions. Metadata text writes respect the caller's capacity and preserve its buffer pointer; termination invalidates existing handles.

Depends on #2232. This stacked branch includes export foundation commit 88e5bdee; the search-only implementation is commit a9a26832 and changes only the search library, its runtime test and TechnicalDebt.

Mixed AND/OR precedence, duration columns and video rows, and mime_type/duration metadata remain unsupported and throw. Unknown handles, paths, fields and argument errors throw when a console error code is unavailable. The catalog is scoped to the launch root's /data/anyps5-content; console-wide captures, permission behavior and locale-dependent text collation remain unverified.

Signatures follow Orbital's ContentSearch declarations. Guest filter enums and layouts, metadata values, the 2400-byte content row, the maximum page size of 92 and known errors follow SharpProspero's ContentSearch bindings. Static assertions check the row offsets and structure sizes.

tools/progress.py classifies five additional declared search exports as implemented (2/7 to 7/7). The export foundation contributes another five exports; the stacked branch contains ten additions in total and each is counted once. These counts reflect implemented entry points; the unsupported cases listed above remain exceptions and do not constitute full console parity.

Tested

Linux, GCC, Release, exact stacked head a9a26832f3a2cdc7e59206704ea3b4c19424a92d: focused guest_content_search_tests build and ctest -R '^guest_content_search$' pass (0.01 s). The test performs real PNG file/thumbnail and data-callback exports, queries their returned paths and persisted rows, verifies all exported and thumbnail bytes, reads title/size/tick/decoded width/height metadata, filters by the host user and queries again after service termination and reinitialization.

Additional file-backed catalog cases check all six comparisons, homogeneous AND/OR groups, sort and pagination, empty results, limit errors, short and unterminated buffers, invalidated handles, deleted files, unknown columns and unsupported video rows with output preservation. Conventions, test registration and git diff --check pass.

The same exact head was configured in a previously built Linux Release worktree: the incremental full default build and libs build pass, including refreshed patched ContentSearch NIDs. Both guest_content_export and the actual guest_content_search roundtrip pass (0.01 s each). The full project test suite was not rerun for this head; these are the relevant runtime tests.

No commercial title or PS5 hardware tested; no main-branch title log reaching these calls is supplied.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #2232
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4800502961 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2234). Originally posted by [erick-dsnk](https://github.com/erick-dsnk) on 2026-10-09T12:37:35Z. --- ### What Implement the five pending `libSceContentSearch` calls for images exported through the host's `libSceContentExport` catalog. Searches now return actual persisted image rows, apply typed comparisons and homogeneous AND/OR groups, sort and paginate results, and expose metadata handles for title, created time, byte size and decoded dimensions. Metadata text writes respect the caller's capacity and preserve its buffer pointer; termination invalidates existing handles. Depends on #2232. This stacked branch includes export foundation commit `88e5bdee`; the search-only implementation is [commit `a9a26832`](https://github.com/erick-dsnk/AnyPS5/commit/a9a26832f3a2cdc7e59206704ea3b4c19424a92d) and changes only the search library, its runtime test and TechnicalDebt. Mixed AND/OR precedence, duration columns and video rows, and `mime_type`/`duration` metadata remain unsupported and throw. Unknown handles, paths, fields and argument errors throw when a console error code is unavailable. The catalog is scoped to the launch root's `/data/anyps5-content`; console-wide captures, permission behavior and locale-dependent text collation remain unverified. Signatures follow [Orbital's ContentSearch declarations](https://github.com/AlexAltea/orbital/blob/cc408367da6a6ebbf5ac1ac559fefeadc73b2831/tools/ida/db_types.json). Guest filter enums and layouts, metadata values, the 2400-byte content row, the maximum page size of 92 and known errors follow [SharpProspero's ContentSearch bindings](https://github.com/SvenGDK/SharpProspero/blob/5dfdb4b0b166e83dc9ae275001afb695f12c7174/src/SharpProspero/Interop/Content/ContentSearch.cs). Static assertions check the row offsets and structure sizes. `tools/progress.py` classifies five additional declared search exports as implemented (2/7 to 7/7). The export foundation contributes another five exports; the stacked branch contains ten additions in total and each is counted once. These counts reflect implemented entry points; the unsupported cases listed above remain exceptions and do not constitute full console parity. ### Tested Linux, GCC, Release, exact stacked head `a9a26832f3a2cdc7e59206704ea3b4c19424a92d`: focused `guest_content_search_tests` build and `ctest -R '^guest_content_search$'` pass (0.01 s). The test performs real PNG file/thumbnail and data-callback exports, queries their returned paths and persisted rows, verifies all exported and thumbnail bytes, reads title/size/tick/decoded width/height metadata, filters by the host user and queries again after service termination and reinitialization. Additional file-backed catalog cases check all six comparisons, homogeneous AND/OR groups, sort and pagination, empty results, limit errors, short and unterminated buffers, invalidated handles, deleted files, unknown columns and unsupported video rows with output preservation. Conventions, test registration and `git diff --check` pass. The same exact head was configured in a previously built Linux Release worktree: the incremental full default build and `libs` build pass, including refreshed patched ContentSearch NIDs. Both `guest_content_export` and the actual `guest_content_search` roundtrip pass (0.01 s each). The full project test suite was not rerun for this head; these are the relevant runtime tests. No commercial title or PS5 hardware tested; no main-branch title log reaching these calls is supplied. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #2232 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-09 12:40:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T12:40:33Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2195 docs/dev/TechnicalDebt.md L40
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6081080552 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2234#issuecomment-6081080552). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T12:40:33Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #2195 | `docs/dev/TechnicalDebt.md` [L40](https://github.com/boykopovar/AnyPS5/blob/8b393b6e9a8ade9188d4f74a0293e0efd9828597/docs/dev/TechnicalDebt.md#L40) | | |
oneandonlydean commented 2026-10-09 20:10:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:10:39Z.


Same as #2232: closing until a title reaches these calls on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088452179 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2234#issuecomment-6088452179). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T20:10:39Z. --- Same as #2232: closing until a title reaches these calls on main.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2234
No description provided.