From 5dd346b6578d8a8a774cc7e9a51903277d464b8c Mon Sep 17 00:00:00 2001 From: croneter Date: Thu, 17 Jan 2019 19:58:07 +0100 Subject: [PATCH] Fix crash on startup-sync due to missing albums --- resources/lib/itemtypes/music.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lib/itemtypes/music.py b/resources/lib/itemtypes/music.py index 300f32dc..afb4a06f 100644 --- a/resources/lib/itemtypes/music.py +++ b/resources/lib/itemtypes/music.py @@ -261,6 +261,14 @@ class Album(MusicMixin, ItemBase): # See if we have a compilation - Plex does NOT feature a compilation # flag for albums compilation = 0 + if children is None: + LOG.info('No children songs passed, getting them') + children = PF.GetAllPlexChildren(plex_id) + try: + children[0].attrib + except (TypeError, IndexError, AttributeError): + LOG.error('Could not get children for Plex id %s', plex_id) + return for song in children: if song.get('originalTitle') is not None: compilation = 1