Skip to content

fix: update Plex watchlist URL#219

Merged
nylonee merged 1 commit intonylonee:mainfrom
btouellette:main
Nov 8, 2025
Merged

fix: update Plex watchlist URL#219
nylonee merged 1 commit intonylonee:mainfrom
btouellette:main

Conversation

@btouellette
Copy link
Copy Markdown
Contributor

@btouellette btouellette commented Aug 17, 2025

Description

This PR updates the Plex watchlist base URL to the new endpoint, replacing the deprecated one.

Checklist

  • Documentation Updated
  • sbt scalafmtAll Run (and optionally sbt scalafmtSbt)
  • At least one approval from a codeowner

Summary by CodeRabbit

  • New Features

    • None
  • Bug Fixes

    • Updated Plex watchlist fetching to use the Discover endpoint, improving reliability of watchlist sync without altering parameters or paging behavior.
  • Tests

    • Adjusted test expectations to match the new Discover watchlist endpoint; test logic and scenarios remain unchanged.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 17, 2025

Walkthrough

The Plex watchlist fetch URL in PlexUtils was updated from metadata.provider.plex.tv to discover.provider.plex.tv. Corresponding test expectations were revised to match the new endpoint. No public signatures or control flow changed; parameters and pagination logic remain the same.

Changes

Cohort / File(s) Summary
Plex watchlist endpoint update
src/main/scala/plex/PlexUtils.scala
Switched watchlist fetch endpoint to https://discover.provider.plex.tv/library/sections/watchlist/all; retained existing query params and paging.
Test updates for discover endpoint
src/test/scala/PlexTokenSyncSpec.scala, src/test/scala/plex/PlexUtilsSpec.scala
Updated test HTTP expectations from metadata.provider.plex.tv to discover.provider.plex.tv for watchlist/all calls; other test logic unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

A hop to Discover, we bound through the logs,
No more Metadata—goodbye, 404 fogs.
Watchlists align, the carrots in row,
Tokens in paw, we’re ready to go.
Thump-thump! New paths, same flow. 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@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: 0

🧹 Nitpick comments (3)
src/main/scala/plex/PlexUtils.scala (1)

74-74: Centralize Plex Discover base URI across code and tests

The switch to the Discover endpoint looks correct and no deprecated URLs remain. To prevent future churn, pull the host (https://discover.provider.plex.tv) into a single constant and use it everywhere—both in PlexUtils and in your specs.

• In src/main/scala/plex/PlexUtils.scala (or its companion object) add:

object PlexUtils {
  /** Base URI for Plex Discover endpoints */
  val DiscoverBase: String = "https://discover.provider.plex.tv"
  // …existing members…
}

• In the watchlist callsite, update:

-        .unsafeFromString("https://discover.provider.plex.tv/library/sections/watchlist/all")
+        .unsafeFromString(s"${PlexUtils.DiscoverBase}/library/sections/watchlist/all")

• In your specs (PlexUtilsSpec.scala, PlexTokenSyncSpec.scala), replace hard-coded URLs:

- Uri.unsafeFromString("https://discover.provider.plex.tv/library/sections/watchlist/all?X-Plex-Token=test-token&X-Plex-Container-Start=0&X-Plex-Container-Size=300")
+ Uri.unsafeFromString(s"${PlexUtils.DiscoverBase}/library/sections/watchlist/all?X-Plex-Token=test-token&X-Plex-Container-Start=0&X-Plex-Container-Size=300")

This optional refactor keeps the host in one place, so any future endpoint changes only need a single update.

src/test/scala/PlexTokenSyncSpec.scala (1)

73-74: Updated expectation to Discover endpoint — LGTM; build the Uri via query params to reduce brittleness

Current expectation uses a fully inlined querystring, which can be brittle if param ordering ever changes. Compose the Uri like production code does.

-          "https://discover.provider.plex.tv/library/sections/watchlist/all?X-Plex-Token=plex-token&X-Plex-Container-Start=0&X-Plex-Container-Size=300"
+          (
+            Uri
+              .unsafeFromString("https://discover.provider.plex.tv/library/sections/watchlist/all")
+              .withQueryParam("X-Plex-Token", "plex-token")
+              .withQueryParam("X-Plex-Container-Start", "0")
+              .withQueryParam("X-Plex-Container-Size", "300")
+          )
src/test/scala/plex/PlexUtilsSpec.scala (1)

82-83: Discover endpoint expectations — LGTM; prefer Uri composition over literal querystrings

These changes are correct. For resilience, compose the Uri via withQueryParam (mirrors production code and avoids strict reliance on param order).

-          "https://discover.provider.plex.tv/library/sections/watchlist/all?X-Plex-Token=test-token&X-Plex-Container-Start=0&X-Plex-Container-Size=300"
+          (
+            Uri
+              .unsafeFromString("https://discover.provider.plex.tv/library/sections/watchlist/all")
+              .withQueryParam("X-Plex-Token", "test-token")
+              .withQueryParam("X-Plex-Container-Start", "0")
+              .withQueryParam("X-Plex-Container-Size", "300")
+          )
-          "https://discover.provider.plex.tv/library/sections/watchlist/all?X-Plex-Token=test-token&X-Plex-Container-Start=0&X-Plex-Container-Size=300"
+          (
+            Uri
+              .unsafeFromString("https://discover.provider.plex.tv/library/sections/watchlist/all")
+              .withQueryParam("X-Plex-Token", "test-token")
+              .withQueryParam("X-Plex-Container-Start", "0")
+              .withQueryParam("X-Plex-Container-Size", "300")
+          )
-          "https://discover.provider.plex.tv/library/sections/watchlist/all?X-Plex-Token=test-token&X-Plex-Container-Start=0&X-Plex-Container-Size=300"
+          (
+            Uri
+              .unsafeFromString("https://discover.provider.plex.tv/library/sections/watchlist/all")
+              .withQueryParam("X-Plex-Token", "test-token")
+              .withQueryParam("X-Plex-Container-Start", "0")
+              .withQueryParam("X-Plex-Container-Size", "300")
+          )

Also applies to: 127-128, 149-150

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dc9ef85 and c7ca0b0.

📒 Files selected for processing (3)
  • src/main/scala/plex/PlexUtils.scala (1 hunks)
  • src/test/scala/PlexTokenSyncSpec.scala (1 hunks)
  • src/test/scala/plex/PlexUtilsSpec.scala (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: nylonee
PR: nylonee/watchlistarr#57
File: src/test/scala/configuration/ConfigurationUtilsSpec.scala:121-130
Timestamp: 2024-06-10T19:44:23.144Z
Learning: The expected result for the test case that verifies the splitting of multiple RSS watchlist feeds is based on the mock HTTP client's response, which may contain a single `RSSInfo` object, rather than directly using the `plexWatchlists` configuration provided. This understanding is crucial for accurately assessing the expected outcomes in test cases.
📚 Learning: 2024-06-10T19:44:23.144Z
Learnt from: nylonee
PR: nylonee/watchlistarr#57
File: src/test/scala/configuration/ConfigurationUtilsSpec.scala:121-130
Timestamp: 2024-06-10T19:44:23.144Z
Learning: The expected result for the test case that verifies the splitting of multiple RSS watchlist feeds is based on the mock HTTP client's response, which may contain a single `RSSInfo` object, rather than directly using the `plexWatchlists` configuration provided. This understanding is crucial for accurately assessing the expected outcomes in test cases.

Applied to files:

  • src/test/scala/plex/PlexUtilsSpec.scala

@cparedes
Copy link
Copy Markdown

@nylonee if you need any help in getting this through, let me know! I'm seeing the same issue on my end and would love to get this merged in

@cparedes
Copy link
Copy Markdown

I've published an image that incorporates the fix in #219: https://hub.docker.com/r/merc248/watchlistarr (replace your image tag with merc248/watchlistarr:latest) in order to unblock folks for now

@mrj214
Copy link
Copy Markdown

mrj214 commented Sep 11, 2025

I've published an image that incorporates the fix in #219: https://hub.docker.com/r/merc248/watchlistarr (replace your image tag with merc248/watchlistarr:latest) in order to unblock folks for now

i didn't see this post before. Great job and thanks ;)

@marcalc
Copy link
Copy Markdown

marcalc commented Nov 1, 2025

@nylonee Would be great to get this merged.

@nylonee
Copy link
Copy Markdown
Owner

nylonee commented Nov 8, 2025

Hi all! Sorry for the delay, just saw these messages. Looking into this now, thanks for the PR and the reviews!

@nylonee nylonee merged commit bce86ec into nylonee:main Nov 8, 2025
@pklingem
Copy link
Copy Markdown

@nylonee would you mind creating a new release so the docker image will be built with this fix?

@coderabbitai coderabbitai bot mentioned this pull request Dec 1, 2025
3 tasks
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.

7 participants