Fixed bugs when Artist or Album not supplied for song

This commit is contained in:
Sumner Evans
2019-10-13 21:04:54 -06:00
parent d6936e15ec
commit bb20c358d6
2 changed files with 9 additions and 4 deletions

View File

@@ -761,9 +761,14 @@ class LibremsonicApp(Gtk.Application):
self.window.present()
try:
notification_lines = []
if song.album:
notification_lines.append(f'<i>{song.album}</i>')
if song.artist:
notification_lines.append(song.artist)
song_notification = Notify.Notification.new(
song.title,
f'<i>{song.album}</i>\n{song.artist}',
'\n'.join(notification_lines),
)
song_notification.add_action(
'clicked',

View File

@@ -265,9 +265,9 @@ class DBusManager:
'mpris:trackid': '/song/' + song.id,
'mpris:length': duration,
'mpris:artUrl': CacheManager.get_cover_art_url(song.id, 1000),
'xesam:album': song.album,
'xesam:albumArtist': [song.artist],
'xesam:artist': [song.artist],
'xesam:album': song.album or '',
'xesam:albumArtist': [song.artist or ''],
'xesam:artist': [song.artist or ''],
'xesam:title': song.title,
}