677
675
item.raw_footer = []
678
676
item.raw_footer.append(song.title)
680
# If the setting for showing "Written by:" is enabled, show it before unspecified authors.
681
if Settings().value('songs/display written by'):
682
item.raw_footer.append("{text}: {authors}".format(text=translate('OpenLP.Ui', 'Written by'),
683
authors=create_separated_list(authors_none)))
685
item.raw_footer.append("{authors}".format(authors=create_separated_list(authors_none)))
678
item.raw_footer.append("{text}: {authors}".format(text=translate('OpenLP.Ui', 'Written by'),
679
authors=create_separated_list(authors_none)))
686
680
if authors_words_music:
687
681
item.raw_footer.append("{text}: {authors}".format(text=AuthorType.Types[AuthorType.WordsAndMusic],
688
682
authors=create_separated_list(authors_words_music)))
696
690
item.raw_footer.append("{text}: {authors}".format(text=AuthorType.Types[AuthorType.Translation],
697
691
authors=create_separated_list(authors_translation)))
698
692
if song.copyright:
699
if self.display_copyright_symbol:
700
item.raw_footer.append("{symbol} {song}".format(symbol=SongStrings.CopyrightSymbol,
701
song=song.copyright))
703
item.raw_footer.append(song.copyright)
704
if self.display_songbook and song.songbook_entries:
705
songbooks = [str(songbook_entry) for songbook_entry in song.songbook_entries]
693
item.raw_footer.append("{symbol} {song}".format(symbol=SongStrings.CopyrightSymbol,
694
song=song.copyright))
695
songbooks = [str(songbook_entry) for songbook_entry in song.songbook_entries]
696
if song.songbook_entries:
706
697
item.raw_footer.append(", ".join(songbooks))
707
698
if Settings().value('core/ccli number'):
708
item.raw_footer.append(translate('SongsPlugin.MediaItem',
709
'CCLI License: ') + Settings().value('core/ccli number'))
710
item.metadata.append('<em>{label}:</em> {title}'.format(label=translate('SongsPlugin.MediaItem', 'Title'),
712
if song.alternate_title:
713
item.metadata.append('<em>{label}:</em> {title}'.
714
format(label=translate('SongsPlugin.MediaItem', 'Alt Title'),
715
title=song.alternate_title))
716
if song.songbook_entries:
717
for songbook_entry in song.songbook_entries:
718
item.metadata.append('<em>{label}:</em> {book}/{num}/{pub}'.
719
format(label=translate('SongsPlugin.MediaItem', 'Songbook'),
720
book=songbook_entry.songbook.name,
721
num=songbook_entry.entry,
722
pub=songbook_entry.songbook.publisher))
724
for topics in song.topics:
725
item.metadata.append('<em>{label}:</em> {topic}'.
726
format(label=translate('SongsPlugin.MediaItem', 'Topic'), topic=topics.name))
699
item.raw_footer.append(translate('SongsPlugin.MediaItem', 'CCLI License: ') +
700
Settings().value('core/ccli number'))
701
footer_template = Settings().value('songs/footer template')
702
# Keep this in sync with the list in songstab.py
705
'alternate_title': song.alternate_title,
706
'authors_none_label': translate('OpenLP.Ui', 'Written by'),
707
'authors_none': authors_none,
708
'authors_words_label': AuthorType.Types[AuthorType.Words],
709
'authors_words': authors_words,
710
'authors_music_label': AuthorType.Types[AuthorType.Music],
711
'authors_music': authors_music,
712
'authors_words_music_label': AuthorType.Types[AuthorType.WordsAndMusic],
713
'authors_words_music': authors_words_music,
714
'authors_translation_label': AuthorType.Types[AuthorType.Translation],
715
'authors_translation': authors_translation,
716
'authors_words_all': authors_words + authors_words_music,
717
'authors_music_all': authors_music + authors_words_music,
718
'copyright': song.copyright,
719
'songbook_entries': songbooks,
720
'ccli_license': Settings().value('core/ccli number'),
721
'ccli_license_label': translate('SongsPlugin.MediaItem', 'CCLI License'),
722
'ccli_number': song.ccli_number,
723
'topics': [topic.name for topic in song.topics]
726
item.footer_html = mako.template.Template(footer_template).render_unicode(**vars).replace('\n', '')
727
except mako.exceptions.SyntaxException:
728
log.error('Failed to render Song footer html:\n' + mako.exceptions.text_error_template().render())
729
critical_error_message_box(message=translate('SongsPlugin.MediaItem',
730
'Failed to render Song footer html.\nSee log for details'))
727
731
return authors_all
729
733
def service_load(self, item):