[api] player photo tagging setting

GET/PUT /api/players/v1/playerPhotoTaggingSetting, ported from the reference's
PlayerDB.Get/SetPlayerPhotoTaggingSetting. Backed by the shared player-settings
KV bag (owned by the `playersettings` worker) under a `PlayerPhotoTaggingSetting`
key rather than its own table.

The setting is served as the enum ORDINAL (0 Anyone / 1 Friends / 2 NoOne) — the
reference registers no JsonStringEnumConverter, so the client decodes a number.
Unset reads back 0; the PUT answers a bare true, or false when the body carries
no recognizable setting, as the reference's bool does.

The write merges into the player's settings map and seeds the `playersettings`
defaults when there is none yet, so writing this key can't cost a player the
seeding that worker's first read would have done.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Devin Zuczek
2026-08-16 00:34:54 -04:00
parent ba0aec92a4
commit f871736839
6 changed files with 267 additions and 0 deletions
+9
View File
@@ -32,6 +32,15 @@
"bucket_name": "recflare-cdn"
}
],
// Per-player settings bag, shared with the `playersettings` worker (which owns it
// and serves the same map at `/playersettings`). Same binding name and same "local"
// id placeholder as that worker's config, so both point at one namespace.
"kv_namespaces": [
{
"binding": "RECFLARE_PLAYER_SETTINGS",
"id": "local"
}
],
// Cross-worker binding to the SignalR notifications hub DO (owned/migrated by
// the `notify` worker). We only invoke its RPC methods; no migration here.
"durable_objects": {