From bcee7dde769783a31c5281ab5888e44d8f795fd0 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 23 Oct 2015 01:45:52 -0500 Subject: [PATCH] First try at fixing singles issue for music --- resources/lib/ReadEmbyDB.py | 7 ++++--- resources/lib/WriteKodiMusicDB.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/lib/ReadEmbyDB.py b/resources/lib/ReadEmbyDB.py index 86bd6b68..3ab12bfd 100644 --- a/resources/lib/ReadEmbyDB.py +++ b/resources/lib/ReadEmbyDB.py @@ -176,13 +176,14 @@ class ReadEmbyDB(): url = "{server}/mediabrowser/Users/{UserId}/Items?StartIndex=%s&Limit=%s&Fields=Etag,Path,Genres,SortName,Studios,Writer,ProductionYear,Taglines,CommunityRating,OfficialRating,CumulativeRunTimeTicks,Metascore,AirTime,DateCreated,MediaStreams,People,Overview&SortBy=DateCreated&Recursive=true&IncludeItemTypes=MusicAlbum&format=json" % (index, jump) jsondata = self.doUtils.downloadUrl(url) - tempresult = [] + #tempresult = [] # Only return valid albums - which have artists - for item in jsondata['Items']: + '''for item in jsondata['Items']: if item['AlbumArtists']: tempresult.append(item) - result.extend(tempresult) + result.extend(tempresult)''' + result.extend(jsondata['Items']) index += jump return result diff --git a/resources/lib/WriteKodiMusicDB.py b/resources/lib/WriteKodiMusicDB.py index e83e895a..c82f637f 100644 --- a/resources/lib/WriteKodiMusicDB.py +++ b/resources/lib/WriteKodiMusicDB.py @@ -331,7 +331,7 @@ class WriteKodiMusicDB(): # Kodi Gotham and Helix query = "INSERT INTO album(idAlbum, strArtists, strGenres, iYear, dateAdded) values(?, ?, ?, ?, ?)" cursor.execute(query, (albumid, artists, genre, year, dateadded)) - + finally: # Link album to artists for artist in MBitem['ArtistItems']: cursor.execute("SELECT kodi_id FROM emby WHERE emby_id = ?", (artist['Id'],))