Skip to content

Expose manifest file tags in the API output - #645

Merged
mtkennerly merged 1 commit into
mtkennerly:masterfrom
ChrisJr404:api-file-tags
Aug 27, 2026
Merged

mtkennerly merged 1 commit into
mtkennerly:masterfrom
ChrisJr404:api-file-tags

Conversation

@ChrisJr404

Copy link
Copy Markdown
Contributor

Summary

Adds a tags field to each file in the --api JSON output, so consumers can tell which files are saves versus configs (and anything else the manifest tags). This is what #534 asked for.

The tags come straight from the manifest entries that matched a file, so a file gets save, config, etc. based on the paths it was found under. As mentioned in the issue, paths can overlap (for example a config directory that contains the save directory), so when more than one manifest entry resolves to the same file its tags are unioned rather than one winning. The field is omitted when empty, so existing output is unchanged and restore output (which has no manifest tags) is unaffected.

Implementation notes

  • ScannedFile now carries the tags collected while scanning for backup.
  • During the backup scan, tags from each manifest file entry are tracked per candidate path and attached to the files found under it, accumulating across overlapping paths.
  • ApiFile exposes them as tags, skipped when empty.

I left the generated docs/schema files alone since regenerating them here also pulls in an unrelated schemars format bump, so that seems better left for a release.

Testing

  • cargo test
  • cargo fmt --all -- --check
  • cargo clippy --workspace -- --deny warnings

Added can_scan_game_for_backup_with_tags covering a config file and a save directory.

Closes #534

@mtkennerly mtkennerly added the enhancement New feature or request label Aug 27, 2026
@mtkennerly mtkennerly added this to the v0.32.0 milestone Aug 27, 2026
@mtkennerly

Copy link
Copy Markdown
Owner

Thanks! This looks good 👍

@mtkennerly
mtkennerly merged commit 80e5327 into mtkennerly:master Aug 27, 2026
9 checks passed
mtkennerly added a commit that referenced this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose manifest file tags in the json api

2 participants