mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 15:32:38 -07:00
Bump plexapi from 4.8.0 to 4.9.1 (#1627)
* Bump plexapi from 4.8.0 to 4.9.1 Bumps [plexapi](https://github.com/pkkid/python-plexapi) from 4.8.0 to 4.9.1. - [Release notes](https://github.com/pkkid/python-plexapi/releases) - [Commits](https://github.com/pkkid/python-plexapi/compare/4.8.0...4.9.1) --- updated-dependencies: - dependency-name: plexapi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update plexapi==4.9.1 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
This commit is contained in:
parent
a4ab5ab9be
commit
7f0abe0fe6
9 changed files with 254 additions and 76 deletions
|
@ -175,8 +175,11 @@ class PlayQueue(PlexObject):
|
|||
args["uri"] = "library:///directory/{uri_args}".format(uri_args=uri_args)
|
||||
args["type"] = items[0].listType
|
||||
elif items.type == "playlist":
|
||||
args["playlistID"] = items.ratingKey
|
||||
args["type"] = items.playlistType
|
||||
if items.radio:
|
||||
args["uri"] = f"server://{server.machineIdentifier}/{server.library.identifier}{items.key}"
|
||||
else:
|
||||
args["playlistID"] = items.ratingKey
|
||||
else:
|
||||
uuid = items.section().uuid
|
||||
args["type"] = items.listType
|
||||
|
@ -192,6 +195,42 @@ class PlayQueue(PlexObject):
|
|||
c._server = server
|
||||
return c
|
||||
|
||||
@classmethod
|
||||
def fromStationKey(cls, server, key):
|
||||
"""Create and return a new :class:`~plexapi.playqueue.PlayQueue`.
|
||||
|
||||
This is a convenience method to create a `PlayQueue` for
|
||||
radio stations when only the `key` string is available.
|
||||
|
||||
Parameters:
|
||||
server (:class:`~plexapi.server.PlexServer`): Server you are connected to.
|
||||
key (str): A station key as provided by :func:`~plexapi.library.LibrarySection.hubs()`
|
||||
or :func:`~plexapi.audio.Artist.station()`
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from plexapi.playqueue import PlayQueue
|
||||
music = server.library.section("Music")
|
||||
artist = music.get("Artist Name")
|
||||
station = artist.station()
|
||||
key = station.key # "/library/metadata/12855/station/8bd39616-dbdb-459e-b8da-f46d0b170af4?type=10"
|
||||
pq = PlayQueue.fromStationKey(server, key)
|
||||
client = server.clients()[0]
|
||||
client.playMedia(pq)
|
||||
"""
|
||||
args = {
|
||||
"type": "audio",
|
||||
"uri": f"server://{server.machineIdentifier}/{server.library.identifier}{key}"
|
||||
}
|
||||
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
|
||||
|
||||
def addItem(self, item, playNext=False, refresh=True):
|
||||
"""
|
||||
Append the provided item to the "Up Next" section of the PlayQueue.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue