Skip to content

Commit

Permalink
fixed mpris player not showing art
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokse22 committed Apr 13, 2024
1 parent f54f51d commit ba47f4c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mpris.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from gi.repository import Gio, GLib, Gdk

from random import randint

from .lib import variables

class Server:
def __init__(self, con, path):
Expand Down Expand Up @@ -266,7 +266,10 @@ def _on_preset_changed(self, *args):
self.__metadata["xesam:title"] = GLib.Variant("s", self.player.playing_track.name)
self.__metadata["xesam:album"] = GLib.Variant("s", self.player.playing_track.album.name)
self.__metadata["xesam:artist"] = GLib.Variant("as", [self.player.playing_track.artist.name])
self.__metadata["xesam:artUrl"] = GLib.Variant("s", f"tmp_img/{self.player.playing_track.album.id}.jpg")

url = f"file://{variables.IMG_DIR}/{self.player.playing_track.album.id}.jpg"

self.__metadata["mpris:artUrl"] = GLib.Variant("s", url)

changed_properties = {
"Metadata": GLib.Variant("a{sv}", self.__metadata),
Expand Down

0 comments on commit ba47f4c

Please sign in to comment.