Fix adding misisng artist on adding an album

This commit is contained in:
croneter 2018-11-25 20:57:16 +01:00
parent 202d33d7c0
commit ded8a59dd7
2 changed files with 30 additions and 11 deletions

View file

@ -238,7 +238,11 @@ class Album(MusicMixin, ItemBase):
LOG.error('Could not get artist %s xml for %s', LOG.error('Could not get artist %s xml for %s',
parent_id, xml.attrib) parent_id, xml.attrib)
return return
Artist(artist_xml[0], section_name, section_id) Artist(self.last_sync,
plexdb=self.plexdb,
kodidb=self.kodidb).add_update(artist_xml[0],
section_name,
section_id)
artist = self.plexdb.artist(parent_id) artist = self.plexdb.artist(parent_id)
if not artist: if not artist:
LOG.error('Adding artist %s failed for %s', LOG.error('Adding artist %s failed for %s',
@ -394,8 +398,11 @@ class Song(MusicMixin, ItemBase):
LOG.error('Grandparent tvartist %s xml download failed for %s', LOG.error('Grandparent tvartist %s xml download failed for %s',
artist_id, xml.attrib) artist_id, xml.attrib)
return return
Artist(self.last_sync, plexdb=self.plexdb, kodidb=self.kodidb).add_update( Artist(self.last_sync,
artist_xml[0], section_name, section_id) plexdb=self.plexdb,
kodidb=self.kodidb).add_update(artist_xml[0],
section_name,
section_id)
artist = self.plexdb.artist(artist_id) artist = self.plexdb.artist(artist_id)
if not artist: if not artist:
LOG.error('Still could not find grandparent artist %s for %s', LOG.error('Still could not find grandparent artist %s for %s',
@ -447,8 +454,11 @@ class Song(MusicMixin, ItemBase):
LOG.error('Parent album %s xml download failed for %s', LOG.error('Parent album %s xml download failed for %s',
album_id, xml.attrib) album_id, xml.attrib)
return return
Album(self.last_sync, plexdb=self.plexdb, kodidb=self.kodidb).add_update( Album(self.last_sync,
album_xml[0], section_name, section_id) plexdb=self.plexdb,
kodidb=self.kodidb).add_update(album_xml[0],
section_name,
section_id)
album = self.plexdb.album(album_id) album = self.plexdb.album(album_id)
if not album: if not album:
LOG.error('Still could not find parent album %s for %s', LOG.error('Still could not find parent album %s for %s',

View file

@ -302,8 +302,11 @@ class Season(ItemBase, TvShowMixin):
except (TypeError, IndexError, AttributeError): except (TypeError, IndexError, AttributeError):
LOG.error("Parent tvshow %s xml download failed", show_id) LOG.error("Parent tvshow %s xml download failed", show_id)
return False return False
Show(self.last_sync, plexdb=self.plexdb, kodidb=self.kodidb).add_update( Show(self.last_sync,
show_xml[0], section_name, section_id) plexdb=self.plexdb,
kodidb=self.kodidb).add_update(show_xml[0],
section_name,
section_id)
show = self.plexdb.show(show_id) show = self.plexdb.show(show_id)
if not show: if not show:
LOG.error('Still could not find parent tv show %s', show_id) LOG.error('Still could not find parent tv show %s', show_id)
@ -373,8 +376,11 @@ class Episode(ItemBase, TvShowMixin):
except (TypeError, IndexError, AttributeError): except (TypeError, IndexError, AttributeError):
LOG.error("Grandparent tvshow %s xml download failed", show_id) LOG.error("Grandparent tvshow %s xml download failed", show_id)
return False return False
Show(self.last_sync, plexdb=self.plexdb, kodidb=self.kodidb).add_update( Show(self.last_sync,
show_xml[0], section_name, section_id) plexdb=self.plexdb,
kodidb=self.kodidb).add_update(show_xml[0],
section_name,
section_id)
show = self.plexdb.show(show_id) show = self.plexdb.show(show_id)
if not show: if not show:
LOG.error('Still could not find grandparent tv show %s', show_id) LOG.error('Still could not find grandparent tv show %s', show_id)
@ -391,8 +397,11 @@ class Episode(ItemBase, TvShowMixin):
except (TypeError, IndexError, AttributeError): except (TypeError, IndexError, AttributeError):
LOG.error("Parent season %s xml download failed", season_id) LOG.error("Parent season %s xml download failed", season_id)
return False return False
Season(self.last_sync, plexdb=self.plexdb, kodidb=self.kodidb).add_update( Season(self.last_sync,
season_xml[0], section_name, section_id) plexdb=self.plexdb,
kodidb=self.kodidb).add_update(season_xml[0],
section_name,
section_id)
season = self.plexdb.season(season_id) season = self.plexdb.season(season_id)
if not season: if not season:
LOG.error('Still could not find parent season %s', season_id) LOG.error('Still could not find parent season %s', season_id)