From 3f55754908a62c7dce74e3a97ec00fbe096bdd4f Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sun, 4 Sep 2016 17:19:00 +0200 Subject: [PATCH] Fix AttributeError --- resources/lib/itemtypes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 5d1a582f..fd0ee550 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -67,7 +67,6 @@ class Items(object): def itemsbyId(self, items, process, pdialog=None): # Process items by itemid. Process can be added, update, userdata, remove - emby = self.emby embycursor = self.embycursor kodicursor = self.kodicursor music_enabled = self.music_enabled @@ -1475,7 +1474,6 @@ class Music(Items): def add_updateSong(self, item, viewtag=None, viewid=None): # Process single song kodicursor = self.kodicursor - emby = self.emby emby_db = self.emby_db artwork = self.artwork API = PlexAPI.API(item) @@ -1700,7 +1698,6 @@ class Music(Items): artistid = artist_edb[0] except TypeError: # Artist is missing from emby database, add it. - artist_full = emby.getItem(artist_eid) artistXml = GetPlexMetadata(artist_eid) if artistXml is None or artistXml == 401: log.error('Error getting artist, abort') @@ -1747,8 +1744,11 @@ class Music(Items): artistid = artist_edb[0] except TypeError: # Artist is missing from emby database, add it. - artist_full = emby.getItem(artist_eid) - self.add_updateArtist(artist_full) + artistXml = GetPlexMetadata(artist_eid) + if artistXml is None or artistXml == 401: + log.error('Error getting artist, abort') + return + self.add_updateArtist(artistXml) artist_edb = emby_db.getItem_byId(artist_eid) artistid = artist_edb[0] finally: