Merge pull request #82 from Hellowlol/str_ratingkey

Fix bug after ratingKey was made int.
This commit is contained in:
Hellowlol 2016-12-21 14:18:24 +01:00 committed by GitHub
commit 8686e6e5bb

View file

@ -74,10 +74,12 @@ class Playlist(PlexPartialObject, Playable):
if not isinstance(items, (list, tuple)): if not isinstance(items, (list, tuple)):
items = [items] items = [items]
ratingKeys = [] ratingKeys = []
for item in items: for item in items:
if item.listType != items[0].listType: if item.listType != items[0].listType:
raise BadRequest('Can not mix media types when building a playlist') raise BadRequest('Can not mix media types when building a playlist')
ratingKeys.append(item.ratingKey) ratingKeys.append(str(item.ratingKey))
ratingKeys = ','.join(ratingKeys) ratingKeys = ','.join(ratingKeys)
uuid = items[0].section().uuid uuid = items[0].section().uuid
path = '/playlists%s' % utils.joinArgs({ path = '/playlists%s' % utils.joinArgs({
@ -86,5 +88,6 @@ class Playlist(PlexPartialObject, Playable):
'title': title, 'title': title,
'smart': 0 'smart': 0
}) })
data = server.query(path, method=server.session.post)[0] data = server.query(path, method=server.session.post)[0]
return cls(server, data, initpath=path) return cls(server, data, initpath=path)