First try at fixing singles issue for music

This commit is contained in:
angelblue05 2015-10-23 01:45:52 -05:00
parent 1893e79014
commit bcee7dde76
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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'],))