-
Notifications
You must be signed in to change notification settings - Fork 39
Description
System Information
Ignis 0.5.post1.dev149+g57017f8fb
Current desktop: niri
os-release:
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
Description
My music media player of choice is Feishin. This player connects to Navidrome, and spits out a Navidrome API url for mpris:artUrl.
https://[navidrome-server]/rest/getCoverArt.view?id=1HADmZpfXtmPvyGxU8vUgY&u=[redacted]&s=7171f1&t=[redacted]v=1.13.0&c=Feishin&size=300&_=2025-08-10T11:47:18.471497493Z
I don't wanna expose my endpoint so I've redacted that, plus my username and token.
Anyway, with this value being passed to mpris.util.uri_to_unix_path, the output, after parsing, unquoting, and basenaming, is getCoverArt.view. This ends up being the case for every album.
Now, mpris.player.MprisPlayer.__load_art_url has this clause
path = ART_URL_CACHE_DIR + "/" + uri_to_unix_path(art_url)
if os.path.exists(path):
return path
# read url, write to cachewhich returns early if the filename already exists. This means that for my setup, the album art never updates after the first load.
How to reproduce
(Assumes a set up Navidrome server, and a connected Feishin client)
- Play a song with album art
- Play another song with different album art
- Observe that the album art doesn't update
Additional Information
I have hacked a way to make it update, but I don't think it's the optimal solution, because it feels like a fairly specific handling of this specific setup.
diff
def uri_to_unix_path(uri: str) -> str:
parsed = urlparse(uri)
if parsed.scheme == "file":
return unquote(os.path.basename(parsed.path))
elif parsed.scheme in ("http", "https"):
+ params = dict(param.split("=") for param in parsed.query.split("&"))
+ if "id" in params:
+ return unquote(os.path.basename(parsed.path + params["id"]))
return unquote(os.path.basename(parsed.path))
else:
raise ValueError(f"Unsupported URI scheme: {parsed.scheme}")