Skip to content

Conversation

@colinhemphill
Copy link
Contributor

@colinhemphill colinhemphill commented Sep 14, 2025

Plex changed the URL for accessing a watchlist from metadata.provider.plex.tv to discover.provider.plex.tv, leading to a 404 status code when using this SDK to pull the watchlist.

This change was also made recently in python-plexapi: pushingkarmaorg/python-plexapi#1544

I didn't see anything else that needed to be updated to accommodate this change, but I certainly could have missed something.

Summary by CodeRabbit

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 14, 2025

📝 Walkthrough

Walkthrough

Masterfully concise, sir: the watchlist endpoint’s server reference was switched from the metadata provider to the discover provider in both the dereferenced OpenAPI output and the source path YAML. No other endpoint structure, parameters, or responses were altered.

Changes

Cohort / File(s) Summary of Changes
OpenAPI dereferenced spec
output/plex-media-server-spec-dereferenced.yaml
Server for /library/sections/watchlist/{filter} updated: URL from https://metadata.provider.plex.tv to https://discover.provider.plex.tv; description adjusted accordingly.
Path definition
src/paths/library/sections/watchlist/get-watch-list.yaml
Path-level servers entry changed from metadata provider to discover provider; only URL and description modified.

Sequence Diagram(s)

sequenceDiagram
  participant C as Client
  participant S as Plex Server
  participant D as Discover Provider

  Note over C,S: GET /library/sections/watchlist/{filter}
  C->>S: Request watchlist (with filter)
  S->>D: Fetch watchlist data
  D-->>S: Data response
  S-->>C: Consolidated response
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant S as Plex Server
  participant M as Metadata Provider
  participant D as Discover Provider

  rect rgba(230,230,230,0.3)
  Note over C,S: Prior flow (before change)
  C->>S: GET /library/sections/watchlist/{filter}
  S->>M: Retrieve watchlist
  M-->>S: Data
  S-->>C: Response
  end

  rect rgba(210,245,230,0.4)
  Note over C,S: New flow (after change)
  C->>S: GET /library/sections/watchlist/{filter}
  S->>D: Retrieve watchlist
  D-->>S: Data
  S-->>C: Response
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

Ahem—new calls ring the bell, not there but here,
From Metadata’s gate to Discover’s peer.
The path unchanged, the footman switched,
The tea still warm, the cups unhitched.
Do carry on, dear endpoint, clear—
Your watchlist waits, now served from near. ☕️

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed Pray allow me to report that the title "Update watchlist server URL to discover.provider.plex.tv" accurately and succinctly captures the principal change in this pull request, namely the watchlist server URL update from metadata.provider.plex.tv to discover.provider.plex.tv. It is specific, directly related to the modified files and the PR objectives, and contains no extraneous or vague wording. Thus it provides a clear, scannable summary for teammates reviewing history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ad9de8 and 2d6d303.

📒 Files selected for processing (2)
  • output/plex-media-server-spec-dereferenced.yaml (1 hunks)
  • src/paths/library/sections/watchlist/get-watch-list.yaml (1 hunks)
🔇 Additional comments (1)
src/paths/library/sections/watchlist/get-watch-list.yaml (1)

2-3: Splendid correction of the watchlist server, sir.

Moving to https://discover.provider.plex.tv aligns with the current endpoint and should quell the 404s post‑haste. Description is consistent. Jolly good.

Comment on lines 5677 to 5683
'/library/sections/watchlist/{filter}':
servers:
- url: 'https://metadata.provider.plex.tv'
description: The plex metadata provider server
- url: 'https://discover.provider.plex.tv'
description: The plex discover provider server
get:
tags:
- Watchlist
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Change appears correct; do verify no stragglers remain, madam/sir.

Kindly confirm there are no remaining references to metadata.provider.plex.tv and that the source path YAML mirrors this change. Also confirm your SDK generator honours path-level servers over top-level servers for this endpoint.


🏁 Script executed:

#!/bin/bash
# 1) Find any lingering metadata provider URLs
rg -nP 'metadata\.provider\.plex\.tv'

# 2) Inspect watchlist path definitions (source + output)
rg -nP '/library/sections/watchlist' -C3

# 3) Sanity-check server objects near the watchlist path
rg -nP '^\s*servers:\s*$' -n output/plex-media-server-spec-dereferenced.yaml -C4

Length of output: 3953


Action required — lingering metadata.provider.plex.tv references detected

  • tests/paths/users/post-sign-in.spec.ts — lines 210, 245, 473, 501 reference "https://metadata.provider.plex.tv"; update tests to the discover URL or to a test fixture that reflects the new host.
  • src/pms-spec.yaml — lines 163–164 ($ref ./paths/library/sections/watchlist/get-watch-list.yaml): verify the referenced source YAML mirrors the path-level server change.
  • output/plex-media-server-spec-dereferenced.yaml — '/library/sections/watchlist/{filter}' shows path-level server https://discover.provider.plex.tv (≈ lines 5677–5681): this is the desired dereferenced state.
  • Confirm the SDK generator honours path-level servers over top-level servers for this endpoint (run a generator smoke-test or inspect generator logic).
🤖 Prompt for AI Agents
In output/plex-media-server-spec-dereferenced.yaml around lines 5677–5683 the
path '/library/sections/watchlist/{filter}' uses the discover provider URL but
tests and source refs still point at metadata.provider.plex.tv; update
tests/tests/paths/users/post-sign-in.spec.ts at lines 210, 245, 473, 501 to use
'https://discover.provider.plex.tv' or replace with a canonical test fixture
that reflects the new host, update src/pms-spec.yaml lines 163–164 (the $ref to
./paths/library/sections/watchlist/get-watch-list.yaml) to ensure the referenced
YAML contains the same path-level server entry, and run or inspect the SDK
generator smoke-test to confirm it respects path-level servers over top-level
servers (fix generator code or tests if it does not).

Comment on lines +5679 to +5680
- url: 'https://discover.provider.plex.tv'
description: The plex discover provider server
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

A deft switch of servers; mind the proper noun, sir.

Recommend capitalising the brand/product for consistency.

-      - url: 'https://discover.provider.plex.tv'
-        description: The plex discover provider server
+      - url: 'https://discover.provider.plex.tv'
+        description: The Plex Discover provider server
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- url: 'https://discover.provider.plex.tv'
description: The plex discover provider server
- url: 'https://discover.provider.plex.tv'
description: The Plex Discover provider server
🤖 Prompt for AI Agents
In output/plex-media-server-spec-dereferenced.yaml around lines 5679 to 5680,
the description uses a lowercase brand name ("The plex discover provider
server"); update it to use the proper capitalised product name by changing the
description to "The Plex discover provider server" (and scan nearby descriptions
for other occurrences of "plex" to correct case for consistency).

Comment on lines +2 to +3
- url: "https://discover.provider.plex.tv"
description: The plex discover provider server
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Do update the changelog and regenerate SDKs, good chap.

This path‑level server change warrants a note in CHANGELOG and regenerated clients to ensure consumers pick up the new base.

🤖 Prompt for AI Agents
In src/paths/library/sections/watchlist/get-watch-list.yaml around lines 2 to 3,
the path-level server URL was changed and this requires updating the project's
changelog and regenerating SDKs/clients; add an entry to the CHANGELOG
describing the server/base URL change (include affected path and reason), then
run the SDK/client generation script(s) used by the repo (e.g.,
openapi-generator, sdkgen, or internal tooling) to produce updated client
libraries and commit the regenerated artifacts alongside the changelog update.

🧹 Nitpick (assertive)

A modest hardening suggestion, if I may.

Consider defining a server with a subdomain variable to ease future host changes without further PRs.

 servers:
-  - url: "https://discover.provider.plex.tv"
-    description: The plex discover provider server
+  - url: "https://{subdomain}.provider.plex.tv"
+    description: The plex provider server (default: discover)
+    variables:
+      subdomain:
+        default: discover
+        enum:
+          - discover
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- url: "https://discover.provider.plex.tv"
description: The plex discover provider server
servers:
- url: "https://{subdomain}.provider.plex.tv"
description: The plex provider server (default: discover)
variables:
subdomain:
default: discover
enum:
- discover
🤖 Prompt for AI Agents
In src/paths/library/sections/watchlist/get-watch-list.yaml around lines 2-3,
the server URL is hardcoded to "https://discover.provider.plex.tv"; replace that
with a servers entry that uses a subdomain variable (e.g.
https://{subdomain}.provider.plex.tv) and declare the subdomain variable with a
sensible default value and description so the host can be changed without PRs.
Ensure the existing hardcoded url is removed and any references use the server
definition rather than in-line host strings.

💡 Verification agent

🧩 Analysis chain

Pray confirm there are no lingering references to the old host.

Kindly sweep the repository for any remnants of metadata.provider.plex.tv (paths, examples, deref output, docs) to avoid mismatched clients.


🏁 Script executed:

#!/bin/bash
# Find any lingering references to the old host and other provider hosts.
rg -nP 'metadata\.provider\.plex\.tv|https?://[a-z.-]*provider\.plex\.tv' -C2

# Sanity-check dereferenced spec paths for this endpoint.
rg -nP "^\\s*servers:\\s*$" -n output/plex-media-server-spec-dereferenced.yaml -C2

Length of output: 6840


Pray remove/update all provider.plex.tv references — action required

Pray attend: the repository still contains multiple references to provider.plex.tv (discover / epg / metadata) that must be corrected to avoid mismatched clients.

  • src/paths/library/sections/watchlist/get-watch-list.yaml — servers.url "https://discover.provider.plex.tv".
  • output/plex-media-server-spec-dereferenced.yaml — '/library/sections/watchlist/{filter}' servers include "https://discover.provider.plex.tv".
  • src/models/UserPlexAccount.yaml — example: "https://epg.provider.plex.tv" (line 193).
  • tests/paths/users/post-sign-in.spec.ts — fixtures referencing epg / epg-staging / epg-dev / metadata / metadata-dev / subtitles-search (matches near lines 140,147,154,210,224,245,403,410,417,473,480,501).

Replace or parameterize these endpoints, update examples/tests, regenerate the dereferenced spec and re-run the test suite.

@LukeHagar LukeHagar merged commit 5478700 into LukeHagar:main Sep 14, 2025
4 checks passed
@LukeHagar
Copy link
Owner

Thank you so much Colin!

I am so looking forward to pro week

@colinhemphill colinhemphill deleted the ch_update_watchlist_server_url branch September 16, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants