Only show hash if song book number exists

This commit is contained in:
Raoul Snyman 2023-02-07 18:01:49 +00:00
parent ec162af360
commit 8a30ba7a24
1 changed files with 5 additions and 2 deletions

View File

@ -568,8 +568,11 @@ class SongMediaItem(MediaManagerItem):
if self.settings.value('songs/add songbook slide') and song.songbook_entries:
first_slide = '\n'
for songbook_entry in song.songbook_entries:
first_slide += '{book} #{num}'.format(book=songbook_entry.songbook.name,
num=songbook_entry.entry)
if songbook_entry.entry:
first_slide += '{book} #{num}'.format(book=songbook_entry.songbook.name,
num=songbook_entry.entry)
else:
first_slide += songbook_entry.songbook.name
if songbook_entry.songbook.publisher:
first_slide += ' ({pub})'.format(pub=songbook_entry.songbook.publisher)
first_slide += '\n\n'