Support songs without albums

This commit is contained in:
angelblue05 2019-01-14 01:21:15 -06:00
parent 40fa688526
commit 6a6e9a597b
2 changed files with 16 additions and 0 deletions

View file

@ -210,6 +210,15 @@ def get_albums_by_artist(artist_id, basic=False):
for items in get_items(None, "MusicAlbum", basic, params): for items in get_items(None, "MusicAlbum", basic, params):
yield items yield items
def get_songs_by_artist(artist_id, basic=False):
params = {
'SortBy': "DateCreated",
'ArtistIds': artist_id
}
for items in get_items(None, "Audio", basic, params):
yield items
@stop() @stop()
def _get_items(query, server_id=None): def _get_items(query, server_id=None):

View file

@ -389,6 +389,13 @@ class FullSync(object):
message="%s/%s/%s" % (message, album['Name'][:7], song['Name'][:7])) message="%s/%s/%s" % (message, album['Name'][:7], song['Name'][:7]))
obj.song(song) obj.song(song)
for songs in server.get_songs_by_artist(artist['Id']):
for song in songs['Items']:
dialog.update(percent, message="%s/%s" % (message, song['Name']))
obj.song(song)
if self.update_library: if self.update_library:
self.music_compare(library, obj, embydb) self.music_compare(library, obj, embydb)