refactor: replace float32/number identifiers with integer types#79
Merged
electather merged 6 commits intomainfrom Mar 16, 2026
Merged
refactor: replace float32/number identifiers with integer types#79electather merged 6 commits intomainfrom
electather merged 6 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace all hand-written
float32flag types andParseFloatcalls with integer types throughout CLI handlers and MCP tool handlers. The auto-generatedpkg/api/client still usesfloat32for API parameters;float32(id)casts remain only at those API call boundaries.Closes #69
Changes
Step 1 — CLI positional arg parsing
strconv.ParseFloat(args[0], 32)withstrconv.ParseInt(args[0], 10, 64)for all commands that accept a numeric ID as a positional argument (movies,tv,users,person,collection,service,issue,tmdb,other,overriderule)request create/updatenow also useParseInt(the[]float32slice stays because the generated API requires it)Step 2 — Cobra flag types
cmd.Flags().Float32("xxx", ...)/GetFloat32("xxx")flag registrations toIntfor pagination params (--page,--take,--skip), ID params (--media-id,--tmdb-id,--requested-by,--server-id,--profile-id,--language-profile-id,--user-id,--tvdb-id,--network,--studio,--permissions, etc.)Step 3 — MCP tool handlers
req.RequireFloat→req.RequireIntandreq.GetFloat→req.GetIntfor all integer IDs and pagination parameters in all MCP tool filesStep 4 — GenreMap
GenreMapkey type fromfloat32tointincmd/mcp/enrich.goTest plan
go test -v ./...passesgo fmt ./...produces no diffgo buildsucceedstests/int_flags_test.goverify decimal IDs and--pageflags are now rejected with a parse errorChecklist
--help, comments)