Skip to content

Commit

Permalink
make album art to be displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
SergSel2006 committed Nov 27, 2022
1 parent 911aa5a commit 47cbc89
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion discordrp_mpris/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,15 @@ async def tick(self) -> None:
activity['state'] = self.format_details("{state}", replacements)

# set icons and hover texts
if player.name in PLAYER_ICONS:
art_icon_url = metadata.get("mpris:artUrl", "")
if art_icon_url and art_icon_url.startswith(
"http"): # TODO make this work with any other URL, as players also use data:image URL
activity['assets'] = {'large_text': player.name,
'large_image': metadata.get("mpris:artUrl", ""),
'small_image': state.lower(),
'small_text': state}

elif player.name in PLAYER_ICONS:
activity['assets'] = {'large_text': player.name,
'large_image': PLAYER_ICONS[player.name],
'small_image': state.lower(),
Expand Down

0 comments on commit 47cbc89

Please sign in to comment.