Fix updating playlist object from XML

This commit is contained in:
Croneter 2018-05-01 16:41:10 +02:00
parent 1a3a94894b
commit 7dde71734c

View file

@ -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):