Revert "Remove API method playlist_type()"
This reverts commit 7b64b794f2
.
This commit is contained in:
parent
7dde71734c
commit
7ddfc0143d
2 changed files with 8 additions and 2 deletions
|
@ -85,6 +85,12 @@ class API(object):
|
||||||
"""
|
"""
|
||||||
return self.item.get('type')
|
return self.item.get('type')
|
||||||
|
|
||||||
|
def playlist_type(self):
|
||||||
|
"""
|
||||||
|
Returns the playlist type ('video', 'audio') or None
|
||||||
|
"""
|
||||||
|
return self.item.get('playlistType')
|
||||||
|
|
||||||
def updated_at(self):
|
def updated_at(self):
|
||||||
"""
|
"""
|
||||||
Returns the last time this item was updated as unicode, e.g.
|
Returns the last time this item was updated as unicode, e.g.
|
||||||
|
|
|
@ -87,7 +87,7 @@ def create_kodi_playlist(plex_id=None):
|
||||||
api = API(xml[0])
|
api = API(xml[0])
|
||||||
playlist = PL.Playlist_Object()
|
playlist = PL.Playlist_Object()
|
||||||
playlist.id = api.plex_id()
|
playlist.id = api.plex_id()
|
||||||
playlist.type = v.KODI_PLAYLIST_TYPE_FROM_PLEX[xml.get('playlistType')]
|
playlist.type = v.KODI_PLAYLIST_TYPE_FROM_PLEX[api.playlist_type()]
|
||||||
playlist.plex_name = api.title()
|
playlist.plex_name = api.title()
|
||||||
playlist.plex_updatedat = api.updated_at()
|
playlist.plex_updatedat = api.updated_at()
|
||||||
LOG.info('Creating new Kodi playlist from Plex playlist %s: %s',
|
LOG.info('Creating new Kodi playlist from Plex playlist %s: %s',
|
||||||
|
@ -289,7 +289,7 @@ def full_sync():
|
||||||
for xml_playlist in xml:
|
for xml_playlist in xml:
|
||||||
api = API(xml_playlist)
|
api = API(xml_playlist)
|
||||||
if (not state.ENABLE_MUSIC and
|
if (not state.ENABLE_MUSIC and
|
||||||
xml.get('playlistType') == v.PLEX_TYPE_AUDIO_PLAYLIST):
|
api.playlist_type() == v.PLEX_TYPE_AUDIO_PLAYLIST):
|
||||||
continue
|
continue
|
||||||
playlist = playlist_object_from_db(plex_id=api.plex_id())
|
playlist = playlist_object_from_db(plex_id=api.plex_id())
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue