Default length to 0 when mpris:length is nil (#89)

This commit is contained in:
Kasper 2021-08-15 11:56:50 +03:00 committed by GitHub
parent 5ae63cd860
commit 0aa1a92c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ local function position_cb()
local player = manager.players[1]
if player then
local position = player:get_position() / 1000000
local length = player.metadata.value["mpris:length"] / 1000000
local length = (player.metadata.value["mpris:length"] or 0) / 1000000
if position ~= last_position or length ~= last_length then
awesome.emit_signal("bling::playerctl::position",
position,