Fix turning generator into list

This commit is contained in:
croneter 2018-10-25 13:19:46 +02:00
parent a060b1fcaa
commit 9bab18367c
2 changed files with 5 additions and 5 deletions

View file

@ -58,7 +58,7 @@ def sync_from_pms():
with PlexDB() as plexdb: with PlexDB() as plexdb:
# Backup old sections to delete them later, if needed (at the end # Backup old sections to delete them later, if needed (at the end
# of this method, only unused sections will be left in old_sections) # of this method, only unused sections will be left in old_sections)
old_sections = [plexdb.section_ids()] old_sections = list(plexdb.section_ids())
with kodidb.GetKodiDB('video') as kodi_db: with kodidb.GetKodiDB('video') as kodi_db:
for section in sections: for section in sections:
_process_section(section, _process_section(section,
@ -67,13 +67,13 @@ def sync_from_pms():
sorted_sections, sorted_sections,
old_sections, old_sections,
totalnodes) totalnodes)
LOG.info('old_sections: %s', old_sections)
if old_sections: if old_sections:
# Section has been deleted on the PMS # Section has been deleted on the PMS
delete_sections(old_sections) delete_sections(old_sections)
# update sections for all: # update sections for all:
with plexdb.PlexDB() as plexdb: with plexdb.PlexDB() as plexdb:
SECTIONS = [plexdb.section_infos()] SECTIONS = list(plexdb.section_infos())
utils.window('Plex.nodes.total', str(totalnodes)) utils.window('Plex.nodes.total', str(totalnodes))
LOG.info("Finished processing library sections: %s", SECTIONS) LOG.info("Finished processing library sections: %s", SECTIONS)
return True return True

View file

@ -22,7 +22,7 @@ def plex_playlist_ids():
Returns a list of all Plex ids of the playlists already in our DB Returns a list of all Plex ids of the playlists already in our DB
""" """
with PlexDB() as plexdb: with PlexDB() as plexdb:
return [plexdb.playlist_ids()] return list(plexdb.playlist_ids())
def kodi_playlist_paths(): def kodi_playlist_paths():
@ -30,7 +30,7 @@ def kodi_playlist_paths():
Returns a list of all Kodi playlist paths of the playlists already synced Returns a list of all Kodi playlist paths of the playlists already synced
""" """
with PlexDB() as plexdb: with PlexDB() as plexdb:
return [plexdb.kodi_playlist_paths()] return list(plexdb.kodi_playlist_paths())
def update_playlist(playlist, delete=False): def update_playlist(playlist, delete=False):