♻️ eww(scripts/mediaplayer): handle artUrl type on script instead of yuck

This commit is contained in:
retrozinndev
2025-01-10 20:02:18 -03:00
parent 2ffd3b3551
commit 3edc080e0f
4 changed files with 13 additions and 13 deletions
+6 -1
View File
@@ -127,12 +127,17 @@ class PlayerManager:
def write_output(self, text, player):
logger.debug(f"Writing output: {text}")
artUrl = player.print_metadata_prop("mpris:artUrl")
if artUrl is not None and not artUrl.startswith("file://") and not artUrl.startswith("http://") and not artUrl.startswith("https://") and artUrl != "null":
artUrl = f"file://{artUrl}"
output = {
"status": player.props.status.lower(),
"title": player.get_title(),
"artist": player.get_artist(),
"player": player.props.player_name.lower(),
"artUrl": player.print_metadata_prop("mpris:artUrl"),
"artUrl": artUrl,
"length": player.print_metadata_prop("mpris:length"),
"url": player.print_metadata_prop("xesam:url")
}