Skip to content

Conversation

@Teagan42
Copy link
Contributor

What

  • retry IMDb IDs via persisted queue
  • handle numeric season titles when fetching TMDb episodes

Why

  • avoid losing IMDb metadata when rate-limited
  • ensure TMDb episode lookups work for year-named seasons

Affects

  • loader, tests, docs

Testing

  • uv run ruff check .
  • uv run pytest

Documentation

  • updated README with IMDb queue notes

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

@github-actions
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
mcp_plex
   cache.py36489%22, 50–52
   imdb_cache.py20290%17–18
   loader.py2632092%33–35, 86, 99–100, 113, 120, 252, 407–409, 419, 422–426, 551, 806
   server.py2982293%59–60, 102–103, 226, 454, 458, 480–486, 518, 528, 559–560, 577–578, 601, 604–605, 663
TOTAL7374893% 

Tests Skipped Failures Errors Time
33 0 💤 0 ❌ 0 🔥 26.585s ⏱️

@Teagan42 Teagan42 merged commit e515bde into main Sep 14, 2025
4 checks passed
@Teagan42 Teagan42 deleted the codex/implement-persistent-imdb-id-retry-queue branch September 14, 2025 06:15
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 suggestions.

Reply with @codex fix comments to fix any unresolved comments.

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, or 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 "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +108 to +113
size = _imdb_retry_queue.qsize()
for _ in range(size):
imdb_id = await _imdb_retry_queue.get()
title = await _fetch_imdb(client, imdb_id)
if title is None:
await _imdb_retry_queue.put(imdb_id)

Choose a reason for hiding this comment

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

[P1] Avoid doubling IMDb retry queue on repeated 429s

When processing the persisted queue, _process_imdb_retry_queue re-enqueues any ID that still returns None, but _fetch_imdb already pushes the same ID back onto _imdb_retry_queue when it hits the final 429 retry (see lines 72‑75). With a rate-limited IMDb API, every failed run doubles the number of queued entries for the same ID, so a single title can balloon to thousands of retries and a large imdb_queue.json, causing unnecessary API calls and potential disk growth once the service recovers. Consider only re-enqueuing here when _fetch_imdb did not already do so.

Useful? React with 👍 / 👎.

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