Skip to content

Commit bef199e

Browse files
committed
replace metadata by discover in watchlist and scrobble urls (API update)
1 parent 9762171 commit bef199e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plexapi/myplex.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ def watchlist(self, filter=None, sort=None, libtype=None, maxresults=None, **kwa
949949

950950
params.update(kwargs)
951951

952-
key = f'{self.METADATA}/library/sections/watchlist/{filter}{utils.joinArgs(params)}'
952+
key = f'{self.DISCOVER}/library/sections/watchlist/{filter}{utils.joinArgs(params)}'
953953
return self._toOnlineMetadata(self.fetchItems(key, maxresults=maxresults), **kwargs)
954954

955955
def onWatchlist(self, item):
@@ -979,7 +979,7 @@ def addToWatchlist(self, items):
979979
if self.onWatchlist(item):
980980
raise BadRequest(f'"{item.title}" is already on the watchlist')
981981
ratingKey = item.guid.rsplit('/', 1)[-1]
982-
self.query(f'{self.METADATA}/actions/addToWatchlist?ratingKey={ratingKey}', method=self._session.put)
982+
self.query(f'{self.DISCOVER}/actions/addToWatchlist?ratingKey={ratingKey}', method=self._session.put)
983983
return self
984984

985985
def removeFromWatchlist(self, items):
@@ -1000,7 +1000,7 @@ def removeFromWatchlist(self, items):
10001000
if not self.onWatchlist(item):
10011001
raise BadRequest(f'"{item.title}" is not on the watchlist')
10021002
ratingKey = item.guid.rsplit('/', 1)[-1]
1003-
self.query(f'{self.METADATA}/actions/removeFromWatchlist?ratingKey={ratingKey}', method=self._session.put)
1003+
self.query(f'{self.DISCOVER}/actions/removeFromWatchlist?ratingKey={ratingKey}', method=self._session.put)
10041004
return self
10051005

10061006
def userState(self, item):
@@ -1010,7 +1010,7 @@ def userState(self, item):
10101010
item (:class:`~plexapi.video.Movie` or :class:`~plexapi.video.Show`): Item to return the user state.
10111011
"""
10121012
ratingKey = item.guid.rsplit('/', 1)[-1]
1013-
data = self.query(f"{self.METADATA}/library/metadata/{ratingKey}/userState")
1013+
data = self.query(f"{self.DISCOVER}/library/metadata/{ratingKey}/userState")
10141014
return self.findItem(data, cls=UserState)
10151015

10161016
def isPlayed(self, item):
@@ -1034,7 +1034,7 @@ def markPlayed(self, item):
10341034
:class:`~plexapi.video.Episode`): Object from searchDiscover().
10351035
Can be also result from Plex Movie or Plex TV Series agent.
10361036
"""
1037-
key = f'{self.METADATA}/actions/scrobble'
1037+
key = f'{self.DISCOVER}/actions/scrobble'
10381038
ratingKey = item.guid.rsplit('/', 1)[-1]
10391039
params = {'key': ratingKey, 'identifier': 'com.plexapp.plugins.library'}
10401040
self.query(key, params=params)
@@ -1049,7 +1049,7 @@ def markUnplayed(self, item):
10491049
:class:`~plexapi.video.Episode`): Object from searchDiscover().
10501050
Can be also result from Plex Movie or Plex TV Series agent.
10511051
"""
1052-
key = f'{self.METADATA}/actions/unscrobble'
1052+
key = f'{self.DISCOVER}/actions/unscrobble'
10531053
ratingKey = item.guid.rsplit('/', 1)[-1]
10541054
params = {'key': ratingKey, 'identifier': 'com.plexapp.plugins.library'}
10551055
self.query(key, params=params)

0 commit comments

Comments
 (0)