From bf925c60e1673a8a49d6d00f76df5cbfb2e49735 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Fri, 19 Apr 2024 10:52:19 -0700 Subject: [PATCH] `addToWatchlist` raise `NotFound` exception for invalid media (#1401) --- plexapi/myplex.py | 4 +++- tests/test_myplex.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plexapi/myplex.py b/plexapi/myplex.py index 8d697924..bc136a9e 100644 --- a/plexapi/myplex.py +++ b/plexapi/myplex.py @@ -963,7 +963,9 @@ class MyPlexAccount(PlexObject): objects to be added to the watchlist. Raises: - :exc:`~plexapi.exceptions.BadRequest`: When trying to add invalid or existing + :exc:`~plexapi.exceptions.BadRequest`: When trying to add existing + media to the watchlist. + :exc:`~plexapi.exceptions.NotFound`: When trying to add invalid media to the watchlist. """ if not isinstance(items, list): diff --git a/tests/test_myplex.py b/tests/test_myplex.py index aac4e84b..9e07d611 100644 --- a/tests/test_myplex.py +++ b/tests/test_myplex.py @@ -310,7 +310,7 @@ def test_myplex_watchlist(account, movie, show, artist): account.removeFromWatchlist(movie) # Test adding invalid item to watchlist - with pytest.raises(BadRequest): + with pytest.raises(NotFound): account.addToWatchlist(artist)