mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 05:01:14 -07:00
Bump plexapi from 4.12.1 to 4.13.1 (#1888)
Bumps [plexapi](https://github.com/pkkid/python-plexapi) from 4.12.1 to 4.13.1. - [Release notes](https://github.com/pkkid/python-plexapi/releases) - [Commits](https://github.com/pkkid/python-plexapi/compare/4.12.1...4.13.1) --- updated-dependencies: - dependency-name: plexapi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
3af08f0d07
commit
e79da07973
20 changed files with 1791 additions and 724 deletions
|
@ -3,7 +3,7 @@ from urllib.parse import quote_plus
|
|||
|
||||
from plexapi import utils
|
||||
from plexapi.base import PlexObject
|
||||
from plexapi.exceptions import BadRequest, Unsupported
|
||||
from plexapi.exceptions import BadRequest
|
||||
|
||||
|
||||
class PlayQueue(PlexObject):
|
||||
|
@ -13,7 +13,7 @@ class PlayQueue(PlexObject):
|
|||
TAG (str): 'PlayQueue'
|
||||
TYPE (str): 'playqueue'
|
||||
identifier (str): com.plexapp.plugins.library
|
||||
items (list): List of :class:`~plexapi.media.Media` or :class:`~plexapi.playlist.Playlist`
|
||||
items (list): List of :class:`~plexapi.base.Playable` or :class:`~plexapi.playlist.Playlist`
|
||||
mediaTagPrefix (str): Fx /system/bundle/media/flags/
|
||||
mediaTagVersion (int): Fx 1485957738
|
||||
playQueueID (int): ID of the PlayQueue.
|
||||
|
@ -27,7 +27,7 @@ class PlayQueue(PlexObject):
|
|||
playQueueSourceURI (str): Original URI used to create the PlayQueue.
|
||||
playQueueTotalCount (int): How many items in the PlayQueue.
|
||||
playQueueVersion (int): Version of the PlayQueue. Increments every time a change is made to the PlayQueue.
|
||||
selectedItem (:class:`~plexapi.media.Media`): Media object for the currently selected item.
|
||||
selectedItem (:class:`~plexapi.base.Playable`): Media object for the currently selected item.
|
||||
_server (:class:`~plexapi.server.PlexServer`): PlexServer associated with the PlayQueue.
|
||||
size (int): Alias for playQueueTotalCount.
|
||||
"""
|
||||
|
@ -90,10 +90,10 @@ class PlayQueue(PlexObject):
|
|||
return matches[0]
|
||||
elif len(matches) > 1:
|
||||
raise BadRequest(
|
||||
"{item} occurs multiple times in this PlayQueue, provide exact item".format(item=item)
|
||||
f"{item} occurs multiple times in this PlayQueue, provide exact item"
|
||||
)
|
||||
else:
|
||||
raise BadRequest("{item} not valid for this PlayQueue".format(item=item))
|
||||
raise BadRequest(f"{item} not valid for this PlayQueue")
|
||||
|
||||
@classmethod
|
||||
def get(
|
||||
|
@ -128,7 +128,7 @@ class PlayQueue(PlexObject):
|
|||
if center:
|
||||
args["center"] = center
|
||||
|
||||
path = "/playQueues/{playQueueID}{args}".format(playQueueID=playQueueID, args=utils.joinArgs(args))
|
||||
path = f"/playQueues/{playQueueID}{utils.joinArgs(args)}"
|
||||
data = server.query(path, method=server._session.get)
|
||||
c = cls(server, data, initpath=path)
|
||||
c._server = server
|
||||
|
@ -150,9 +150,9 @@ class PlayQueue(PlexObject):
|
|||
|
||||
Parameters:
|
||||
server (:class:`~plexapi.server.PlexServer`): Server you are connected to.
|
||||
items (:class:`~plexapi.media.Media` or :class:`~plexapi.playlist.Playlist`):
|
||||
items (:class:`~plexapi.base.Playable` or :class:`~plexapi.playlist.Playlist`):
|
||||
A media item, list of media items, or Playlist.
|
||||
startItem (:class:`~plexapi.media.Media`, optional):
|
||||
startItem (:class:`~plexapi.base.Playable`, optional):
|
||||
Media item in the PlayQueue where playback should begin.
|
||||
shuffle (int, optional): Start the playqueue shuffled.
|
||||
repeat (int, optional): Start the playqueue shuffled.
|
||||
|
@ -171,8 +171,8 @@ class PlayQueue(PlexObject):
|
|||
|
||||
if isinstance(items, list):
|
||||
item_keys = ",".join([str(x.ratingKey) for x in items])
|
||||
uri_args = quote_plus("/library/metadata/{item_keys}".format(item_keys=item_keys))
|
||||
args["uri"] = "library:///directory/{uri_args}".format(uri_args=uri_args)
|
||||
uri_args = quote_plus(f"/library/metadata/{item_keys}")
|
||||
args["uri"] = f"library:///directory/{uri_args}"
|
||||
args["type"] = items[0].listType
|
||||
elif items.type == "playlist":
|
||||
args["type"] = items.playlistType
|
||||
|
@ -183,15 +183,14 @@ class PlayQueue(PlexObject):
|
|||
else:
|
||||
uuid = items.section().uuid
|
||||
args["type"] = items.listType
|
||||
args["uri"] = "library://{uuid}/item/{key}".format(uuid=uuid, key=items.key)
|
||||
args["uri"] = f"library://{uuid}/item/{items.key}"
|
||||
|
||||
if startItem:
|
||||
args["key"] = startItem.key
|
||||
|
||||
path = "/playQueues{args}".format(args=utils.joinArgs(args))
|
||||
path = f"/playQueues{utils.joinArgs(args)}"
|
||||
data = server.query(path, method=server._session.post)
|
||||
c = cls(server, data, initpath=path)
|
||||
c.playQueueType = args["type"]
|
||||
c._server = server
|
||||
return c
|
||||
|
||||
|
@ -227,7 +226,6 @@ class PlayQueue(PlexObject):
|
|||
path = f"/playQueues{utils.joinArgs(args)}"
|
||||
data = server.query(path, method=server._session.post)
|
||||
c = cls(server, data, initpath=path)
|
||||
c.playQueueType = args["type"]
|
||||
c._server = server
|
||||
return c
|
||||
|
||||
|
@ -237,7 +235,7 @@ class PlayQueue(PlexObject):
|
|||
Items can only be added to the section immediately following the current playing item.
|
||||
|
||||
Parameters:
|
||||
item (:class:`~plexapi.media.Media` or :class:`~plexapi.playlist.Playlist`): Single media item or Playlist.
|
||||
item (:class:`~plexapi.base.Playable` or :class:`~plexapi.playlist.Playlist`): Single media item or Playlist.
|
||||
playNext (bool, optional): If True, add this item to the front of the "Up Next" section.
|
||||
If False, the item will be appended to the end of the "Up Next" section.
|
||||
Only has an effect if an item has already been added to the "Up Next" section.
|
||||
|
@ -250,21 +248,17 @@ class PlayQueue(PlexObject):
|
|||
args = {}
|
||||
if item.type == "playlist":
|
||||
args["playlistID"] = item.ratingKey
|
||||
itemType = item.playlistType
|
||||
else:
|
||||
uuid = item.section().uuid
|
||||
itemType = item.listType
|
||||
args["uri"] = "library://{uuid}/item{key}".format(uuid=uuid, key=item.key)
|
||||
|
||||
if itemType != self.playQueueType:
|
||||
raise Unsupported("Item type does not match PlayQueue type")
|
||||
args["uri"] = f"library://{uuid}/item{item.key}"
|
||||
|
||||
if playNext:
|
||||
args["next"] = 1
|
||||
|
||||
path = "/playQueues/{playQueueID}{args}".format(playQueueID=self.playQueueID, args=utils.joinArgs(args))
|
||||
path = f"/playQueues/{self.playQueueID}{utils.joinArgs(args)}"
|
||||
data = self._server.query(path, method=self._server._session.put)
|
||||
self._loadData(data)
|
||||
return self
|
||||
|
||||
def moveItem(self, item, after=None, refresh=True):
|
||||
"""
|
||||
|
@ -290,11 +284,10 @@ class PlayQueue(PlexObject):
|
|||
after = self.getQueueItem(after)
|
||||
args["after"] = after.playQueueItemID
|
||||
|
||||
path = "/playQueues/{playQueueID}/items/{playQueueItemID}/move{args}".format(
|
||||
playQueueID=self.playQueueID, playQueueItemID=item.playQueueItemID, args=utils.joinArgs(args)
|
||||
)
|
||||
path = f"/playQueues/{self.playQueueID}/items/{item.playQueueItemID}/move{utils.joinArgs(args)}"
|
||||
data = self._server.query(path, method=self._server._session.put)
|
||||
self._loadData(data)
|
||||
return self
|
||||
|
||||
def removeItem(self, item, refresh=True):
|
||||
"""Remove an item from the PlayQueue.
|
||||
|
@ -309,20 +302,21 @@ class PlayQueue(PlexObject):
|
|||
if item not in self:
|
||||
item = self.getQueueItem(item)
|
||||
|
||||
path = "/playQueues/{playQueueID}/items/{playQueueItemID}".format(
|
||||
playQueueID=self.playQueueID, playQueueItemID=item.playQueueItemID
|
||||
)
|
||||
path = f"/playQueues/{self.playQueueID}/items/{item.playQueueItemID}"
|
||||
data = self._server.query(path, method=self._server._session.delete)
|
||||
self._loadData(data)
|
||||
return self
|
||||
|
||||
def clear(self):
|
||||
"""Remove all items from the PlayQueue."""
|
||||
path = "/playQueues/{playQueueID}/items".format(playQueueID=self.playQueueID)
|
||||
path = f"/playQueues/{self.playQueueID}/items"
|
||||
data = self._server.query(path, method=self._server._session.delete)
|
||||
self._loadData(data)
|
||||
return self
|
||||
|
||||
def refresh(self):
|
||||
"""Refresh the PlayQueue from the Plex server."""
|
||||
path = "/playQueues/{playQueueID}".format(playQueueID=self.playQueueID)
|
||||
path = f"/playQueues/{self.playQueueID}"
|
||||
data = self._server.query(path, method=self._server._session.get)
|
||||
self._loadData(data)
|
||||
return self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue