Only send artUrl to the signal if it's not empty

This commit is contained in:
Ksaper 2021-07-25 06:36:34 +03:00
parent f3239891bf
commit e74671094a
1 changed files with 15 additions and 9 deletions

View File

@ -98,15 +98,21 @@ local function metadata_cb(player, metadata)
if player ~= last_player or title ~= last_title or
artist ~= last_artist or artUrl ~= last_artUrl
then
awful.spawn.with_line_callback(get_album_art(artUrl), {
stdout = function(line)
awesome.emit_signal("bling::playerctl::title_artist_album",
title,
artist,
line,
player.player_name)
end
})
if artUrl ~= "" then
awful.spawn.with_line_callback(get_album_art(artUrl), {
stdout = function(line)
awesome.emit_signal("bling::playerctl::title_artist_album",
title,
artist,
line,
player.player_name)
end
})
else
awesome.emit_signal(
"bling::playerctl::title_artist_album", title,
artist, player.player_name)
end
-- Re-sync with position timer when track changes
position_timer:again()
last_player = player