Merge pull request #534 from AdrienLemaire/chore/mediaplayer

feat: show title if artist isn't available
This commit is contained in:
Alex 2020-01-01 15:51:50 +01:00 committed by GitHub
commit def4466953
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -38,6 +38,8 @@ def on_metadata(player, metadata, manager):
elif player.get_artist() != '' and player.get_title() != '': elif player.get_artist() != '' and player.get_title() != '':
track_info = '{artist} - {title}'.format(artist=player.get_artist(), track_info = '{artist} - {title}'.format(artist=player.get_artist(),
title=player.get_title()) title=player.get_title())
else:
track_info = player.get_title()
if player.props.status != 'Playing' and track_info: if player.props.status != 'Playing' and track_info:
track_info = '' + track_info track_info = '' + track_info
@ -123,4 +125,3 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
main() main()