Merge branch 'minor_fixes2' into 'master'

Stop Service File items from containing more than one audio file

See merge request openlp/openlp!742
This commit is contained in:
Raoul Snyman 2024-04-20 22:14:30 +00:00
commit 7bb7dc35c0
1 changed files with 3 additions and 1 deletions

View File

@ -628,9 +628,11 @@ class SongMediaItem(MediaManagerItem):
if State().check_preconditions('media'):
service_item.add_capability(ItemCapabilities.HasBackgroundAudio)
total_length = 0
# We could have stored multiple files but only the first one will be played.
for m in song.media_files:
total_length += self.media_controller.media_length(m.file_path)
service_item.background_audio = [(m.file_path, m.file_hash) for m in song.media_files]
service_item.background_audio = [(m.file_path, m.file_hash)]
break
service_item.set_media_length(total_length)
service_item.metadata.append('<em>{label}:</em> {media}'.
format(label=translate('SongsPlugin.MediaItem', 'Media'),