Song details api

This commit is contained in:
Daniel 2020-10-19 07:18:00 +00:00 committed by Tomas Groth
parent 0fc95c22b2
commit fd7ba2a447
3 changed files with 10 additions and 4 deletions

View File

@ -883,6 +883,7 @@ class ServiceItem(RegistryProperties):
'footer': self.raw_footer,
'audit': self.audit,
'notes': self.notes,
'data': self.data_string or {},
'fromPlugin': self.from_plugin,
'capabilities': self.capabilities,
'backgroundAudio': [str(file_path) for file_path in self.background_audio],

View File

@ -616,8 +616,10 @@ class SongMediaItem(MediaManagerItem):
author_list = self.generate_footer(service_item, song)
service_item.data_string = {
'title': song.search_title,
'alternate_title': song.alternate_title,
'authors': ', '.join(author_list),
'ccli_number': song.ccli_number
'ccli_number': song.ccli_number,
'copyright': song.copyright
}
service_item.xml_version = self.open_lyrics.song_to_xml(song)
# Add the audio file to the service item.

View File

@ -804,7 +804,8 @@ def test_to_dict_text_item(state_media, settings, service_item_env):
],
'theme': None,
'title': 'Amazing Grace',
'type': 'ServiceItemType.Text'
'type': 'ServiceItemType.Text',
'data': {'authors': 'John Newton', 'title': 'amazing grace@'}
}
assert result == expected_dict
@ -854,7 +855,8 @@ def test_to_dict_image_item(mocked_image_to_data_uri, mocked_get_data_path, stat
],
'theme': -1,
'title': 'Images',
'type': 'ServiceItemType.Image'
'type': 'ServiceItemType.Image',
'data': {}
}
assert result == expected_dict
@ -909,6 +911,7 @@ def test_to_dict_presentation_item(mocked_image_uri, mocked_get_data_path, state
],
'theme': None,
'title': '',
'type': 'ServiceItemType.Command'
'type': 'ServiceItemType.Command',
'data': {}
}
assert result == expected_dict