This commit is contained in:
Andreas Preikschat 2011-02-10 18:11:14 +01:00
parent a74b6857c8
commit 8498b3e2ae
1 changed files with 5 additions and 3 deletions

View File

@ -149,12 +149,14 @@ class SongsPlugin(Plugin):
counter += 1 counter += 1
# The song does not have any author, add one. # The song does not have any author, add one.
if not song.authors: if not song.authors:
name = unicode(translate('SongsPlugin', 'Author unknown')) name = unicode(translate('SongsPlugin', 'Author unknown',
'Translation must contain a blank character!'))
author = self.manager.get_object_filtered(Author, author = self.manager.get_object_filtered(Author,
Author.display_name == name) Author.display_name == name)
if author is None: if author is None:
author = Author.populate(first_name=name.rsplit(u' ', 1)[0], author = Author.populate(
last_name=name.rsplit(u' ', 1)[1], display_name=name) first_name=name.split(u' ', 1)[:-1],
last_name=name.split(u' ', 1)[-1], display_name=name)
song.authors.append(author) song.authors.append(author)
if song.title is None: if song.title is None:
song.title = u'' song.title = u''