Skip to content

Conversation

@Teagan42
Copy link
Contributor

@Teagan42 Teagan42 commented Oct 7, 2025

What

  • move the Click-based loader CLI into mcp_plex/loader/cli.py and add a module entrypoint that reuses it
  • leave mcp_plex.loader focused on orchestration helpers while keeping load_media/run import friendly
  • update the console script wiring, version metadata, and tests to reference the new CLI module

Why

  • decouples CLI concerns from mcp_lex.loader imports so the package can be imported without triggering Click setup

Affects

  • loader CLI invocation, packaging metadata, loader-focused test cases

Testing

  • uv run pytest

Documentation

  • no documentation changes required

https://chatgpt.com/codex/tasks/task_e_68e49915cc988328a7cf757de8a1f322

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
mcp_plex/common
   validation.py28293%37–38
mcp_plex/loader
   __init__.py3741795%84–91, 165, 255–260, 662, 777–779, 781, 867–886
   __main__.py440%2–8
   imdb_cache.py43295%59, 63
mcp_plex/loader/pipeline
   channels.py64297%134–135
   enrichment.py5167585%237, 259–265, 318, 323, 354, 356, 363, 367, 471, 492, 512, 520–522, 525–527, 530–532, 540–545, 553, 607–608, 632, 692–693, 709, 738, 745, 747, 751, 803, 821, 833, 862, 868, 871–879, 905, 908–910, 927–929, 949–952, 956, 970–976, 998, 1000, 1003–1005
   ingestion.py1551392%81, 130–150, 185, 222, 238, 331, 337, 357
   orchestrator.py95595%63, 141, 170, 193–194
   persistence.py130993%122, 164–165, 175, 186, 190–192, 245
mcp_plex/server
   __init__.py6523295%53–54, 134–135, 163, 213, 239, 245–246, 315, 336–339, 356, 421, 424, 461, 479–480, 517, 1191, 1213–1219, 1255, 1273, 1278, 1296, 1420, 1457
   __main__.py440%3–8
   config.py48785%50, 52–55, 65, 76
TOTAL234617293% 

Tests Skipped Failures Errors Time
149 0 💤 0 ❌ 0 🔥 1m 18s ⏱️

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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

Comment on lines +107 to +132
@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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Teagan42 Teagan42 merged commit 1b15811 into main Oct 7, 2025
4 checks passed
@Teagan42 Teagan42 deleted the codex/create-cli-in-mcp_lex.loader.cli branch October 7, 2025 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants