-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: move loader CLI entrypoint #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| @click.option( | ||
| "--plex-chunk-size", | ||
| envvar="PLEX_CHUNK_SIZE", | ||
| show_envvar=True, | ||
| type=int, | ||
| default=20, | ||
| show_default=True, | ||
| help="Number of Plex items to fetch per API call", | ||
| ) | ||
| @click.option( | ||
| "--enrichment-batch-size", | ||
| envvar="ENRICHMENT_BATCH_SIZE", | ||
| show_envvar=True, | ||
| type=int, | ||
| default=5, | ||
| show_default=True, | ||
| help="Number of items to enrich concurrently", | ||
| ) | ||
| @click.option( | ||
| "--enrichment-workers", | ||
| envvar="ENRICHMENT_WORKERS", | ||
| show_envvar=True, | ||
| type=int, | ||
| default=5, | ||
| show_default=True, | ||
| help="Number of enrichment workers", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore loader CLI batch defaults
Moving the Click entrypoint into cli.py reset several option defaults: --plex-chunk-size now defaults to 20 instead of the previous 200, --enrichment-batch-size is 5 instead of 100, and --enrichment-workers is 5 instead of 4. The underlying run() helpers in mcp_plex.loader still use the larger defaults, so invoking the CLI will now fetch and enrich media in dramatically smaller batches, increasing the number of Plex/TMDb/IMDb calls and materially slowing down ingestion. If this behavioral change wasn’t intended, the defaults here should match the existing values in run() to avoid a large performance regression.
Useful? React with 👍 / 👎.
What
mcp_plex/loader/cli.pyand add a module entrypoint that reuses itmcp_plex.loaderfocused on orchestration helpers while keepingload_media/runimport friendlyWhy
mcp_lex.loaderimports so the package can be imported without triggering Click setupAffects
Testing
uv run pytestDocumentation
https://chatgpt.com/codex/tasks/task_e_68e49915cc988328a7cf757de8a1f322