mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-29 07:00:19 +00:00
Minor bugfixes
This commit is contained in:
parent
e5fc43a85f
commit
ba9eab0229
4 changed files with 15 additions and 14 deletions
|
@ -19,13 +19,6 @@ class PlexClient(object):
|
|||
self.session = session or requests.Session()
|
||||
self.server = server
|
||||
self._loadData(data) if data is not None else self.connect()
|
||||
# active session details
|
||||
self.device = data.attrib.get('device')
|
||||
self.model = data.attrib.get('model')
|
||||
self.state = data.attrib.get('state')
|
||||
self.vendor = data.attrib.get('vendor')
|
||||
self.version = data.attrib.get('version')
|
||||
# private class variables
|
||||
self._proxyThroughServer = False
|
||||
self._commandId = 0
|
||||
|
||||
|
@ -39,6 +32,12 @@ class PlexClient(object):
|
|||
self.platform = data.attrib.get('platform')
|
||||
self.platformVersion = data.attrib.get('platformVersion')
|
||||
self.title = data.attrib.get('title') or data.attrib.get('name')
|
||||
# active session details
|
||||
self.device = data.attrib.get('device')
|
||||
self.model = data.attrib.get('model')
|
||||
self.state = data.attrib.get('state')
|
||||
self.vendor = data.attrib.get('vendor')
|
||||
self.version = data.attrib.get('version')
|
||||
|
||||
def connect(self):
|
||||
try:
|
||||
|
|
|
@ -78,8 +78,8 @@ class Playlist(PlexPartialObject, Playable):
|
|||
if item.listType != items[0].listType:
|
||||
raise BadRequest('Can not mix media types when building a playlist')
|
||||
ratingKeys.append(item.ratingKey)
|
||||
uuid = items[0].section().uuid
|
||||
ratingKeys = ','.join(ratingKeys)
|
||||
uuid = items[0].section().uuid
|
||||
path = '/playlists%s' % utils.joinArgs({
|
||||
'uri': 'library://%s/directory//library/metadata/%s' % (uuid, ratingKeys),
|
||||
'type': items[0].listType,
|
||||
|
|
|
@ -22,12 +22,12 @@ class PlayQueue(object):
|
|||
self.items = [utils.buildItem(server, elem, initpath) for elem in data]
|
||||
|
||||
@classmethod
|
||||
def create(cls, server, video, shuffle=0, continuous=0):
|
||||
uuid = video.section().uuid
|
||||
def create(cls, server, item, shuffle=0, continuous=0):
|
||||
uuid = item.section().uuid
|
||||
path = '/playQueues%s' % utils.joinArgs({
|
||||
'uri': 'library://%s/item/%s' % (uuid, video.key),
|
||||
'key': video.key,
|
||||
'type': 'video',
|
||||
'uri': 'library://%s/item/%s' % (uuid, item.key),
|
||||
'key': item.key,
|
||||
'type': item.listType,
|
||||
'shuffle': shuffle,
|
||||
'continuous': continuous,
|
||||
'X-Plex-Client-Identifier': plexapi.X_PLEX_IDENTIFIER,
|
||||
|
|
|
@ -345,7 +345,9 @@ def test_play_playlist(plex, account=None):
|
|||
print(album.__dict__)
|
||||
playlist = plex.createPlaylist('test_play_playlist', album)
|
||||
try:
|
||||
print(playlist)
|
||||
log(2, 'Playing playlist: %s' % playlist)
|
||||
client.playMedia(playlist)
|
||||
raise Exception('Test Not Finished')
|
||||
finally:
|
||||
playlist.delete()
|
||||
|
||||
|
|
Loading…
Reference in a new issue