This commit is contained in:
Andreas Preikschat 2010-12-17 14:30:48 +01:00
parent e257f0431b
commit 3cdac511e2
1 changed files with 13 additions and 7 deletions

View File

@ -429,20 +429,26 @@ class SongMediaItem(MediaManagerItem):
if search_results: if search_results:
for song in search_results: for song in search_results:
same_authors = True same_authors = True
for author in song.authors: # If the author counts are different, we do not have to do
if author.display_name not in author_list: # any further checking. This is also important when a song
same_authors = False # does not have any author (because we can not loop over an
# All Authors the same, so we can stop here and the song # empty list).
if len(song.authors) == len(author_list):
for author in song.authors:
if author.display_name not in author_list:
same_authors = False
else:
same_authors = False
# All authors are the same, so we can stop here and the song
# does not have to be saved. # does not have to be saved.
if same_authors: if same_authors:
editId = song.id
add_song = False add_song = False
editId = song.id
break break
if add_song: if add_song:
# Authors different
if self.addSongFromService: if self.addSongFromService:
editId = self.openLyrics.xml_to_song(item.xml_version) editId = self.openLyrics.xml_to_song(item.xml_version)
# Update service with correct song id # Update service with correct song id.
if editId != 0: if editId != 0:
Receiver.send_message(u'service_item_update', Receiver.send_message(u'service_item_update',
u'%s:%s' %(editId, uuid)) u'%s:%s' %(editId, uuid))