Fix updating playlist object from XML
This commit is contained in:
parent
1a3a94894b
commit
7dde71734c
1 changed files with 7 additions and 11 deletions
|
@ -428,17 +428,13 @@ def get_playlist_details_from_xml(playlist, xml):
|
|||
|
||||
Raises PlaylistError if something went wrong.
|
||||
"""
|
||||
try:
|
||||
playlist.id = xml.attrib['%sID' % playlist.kind]
|
||||
playlist.version = xml.attrib['%sVersion' % playlist.kind]
|
||||
playlist.shuffled = xml.attrib['%sShuffled' % playlist.kind]
|
||||
playlist.selectedItemID = xml.attrib.get(
|
||||
'%sSelectedItemID' % playlist.kind)
|
||||
playlist.selectedItemOffset = xml.attrib.get(
|
||||
playlist.id = xml.get('%sID' % playlist.kind)
|
||||
playlist.version = xml.get('%sVersion' % playlist.kind)
|
||||
playlist.shuffled = xml.get('%sShuffled' % playlist.kind)
|
||||
playlist.selectedItemID = xml.get('%sSelectedItemID' % playlist.kind)
|
||||
playlist.selectedItemOffset = xml.get(
|
||||
'%sSelectedItemOffset' % playlist.kind)
|
||||
LOG.debug('Updated playlist from xml: %s', playlist)
|
||||
except (TypeError, KeyError, AttributeError):
|
||||
raise PlaylistError('Could not get playlist details from xml')
|
||||
|
||||
|
||||
def update_playlist_from_PMS(playlist, playlist_id=None, xml=None):
|
||||
|
|
Loading…
Reference in a new issue