Merge pull request #421 from SibrenVasse/media_fix

fix(custom): ignore selected_player if not defined. Fixes #419
This commit is contained in:
Alex 2019-07-31 12:13:45 +02:00 committed by GitHub
commit 43beefb00d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -140,5 +140,6 @@
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
}
}

View File

@ -45,7 +45,7 @@ def on_metadata(player, metadata, manager):
def on_player_appeared(manager, player, selected_player=None):
if player is not None and player.name == selected_player:
if player is not None and (selected_player is None or player.name == selected_player):
init_player(manager, player)
else:
logger.debug("New player appeared, but it's not the selected player, skipping")