forked from openlp/openlp
Restore setting a default author
This commit is contained in:
parent
31b220c972
commit
dffee7fbc1
@ -389,6 +389,13 @@ def clean_song(manager, song):
|
||||
song.lyrics = str(song.lyrics, encoding='utf8')
|
||||
verses = SongXML().get_verses(song.lyrics)
|
||||
song.search_lyrics = ' '.join([clean_string(verse[1]) for verse in verses])
|
||||
# The song does not have any author, add one.
|
||||
if not song.authors and not song.authors_songs: # Need to check both relations
|
||||
name = SongStrings.AuthorUnknown
|
||||
author = manager.get_object_filtered(Author, Author.display_name == name)
|
||||
if author is None:
|
||||
author = Author.populate(display_name=name, last_name='', first_name='')
|
||||
song.authors.append(author)
|
||||
if song.copyright:
|
||||
song.copyright = CONTROL_CHARS.sub('', song.copyright).strip()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user