feat(api): add Buddy Showcase focus filtering - #397
Conversation
Cherry-picked from #397 (Mygod:codex/showcase-focus-filter) onto the fort API branch so the showcase work lands with the availability enrichment it depends on. Conflicts resolved by keeping both sides' additions: - FortLookup gains ShowcaseBuddyMinLevel alongside ShowcaseRankingStandard; both int8s share the pad before ShowcaseExpiry, so the struct stays 184 B. - showcaseKey keys on ranking standard AND structured focus. - ApiPokestopShowcaseAvailable carries ranking_standard and showcase_focus. Also corrected the showcase_focus nullability doc: it is null for legacy rows and for rows whose stored focus fails to parse, not only the former. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thanks for this — I've cherry-picked 8e10f6c into #393 ( Conflicts were all additive and resolved by keeping both sides:
Two small changes on top:
One thing worth flagging that this PR inherits rather than introduces. Closing in favour of #393 once that merges — the commit and the credit carry over. |
Summary
contest_focusselector to Pokéstop and combined fort-scan DNF filtersmax_fort_results, so unrelated Showcases cannot consume the endpoint capshowcase_focusvalues as native JSON objects and advertiseshowcase_focus_filter: truethrough both availability endpointsshowcase_focusduring cache-miss/startup population and keep only a compact Buddy-level projection in the hot fort lookupExample filter:
{ "contest_focus": [ { "type": "buddy", "min_level": 3 } ] }Compatibility
contest_pokemonandcontest_pokemon_typefilters are unchangedpokemon_id,form, andtype_idmirrors remain availableshowcase_focus: nullshowcase_focuswire representation is unchangedshowcase_focus_filtercapability as an older GolbatRelated to WatWowMap/ReactMap#1090.
Verification
go test -tags go_json ./...go build -tags go_json ./...go test -race ./decoder/coverage for parsing, indexing, DNF matching, cap ordering, and availabilitygo run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 run— 0 issuesgit diff --check origin/main...HEAD