diff --git a/ags/widget/center-window/BigMedia.ts b/ags/widget/center-window/BigMedia.ts index 48d4116..53d0fea 100644 --- a/ags/widget/center-window/BigMedia.ts +++ b/ags/widget/center-window/BigMedia.ts @@ -172,15 +172,15 @@ export function BigMedia(): Gtk.Widget { * @param player the player you want to pull album art from * @returns Binding to player.artUrl containing the album art uri, or an undefined binding ig none was found. * */ -function getAlbumArt(player: AstalMpris.Player): Binding { +function getAlbumArt(player: AstalMpris.Player): Binding { return bind(player, "artUrl").as((artUrl: string) => { - const finalUrl: string = artUrl; - if(/^(https|http)$/.test(finalUrl.split("://")[0])) - return artUrl; - else if(artUrl.startsWith("/")) + if(!artUrl) + return undefined; + + if(artUrl.startsWith("/")) return "file://" + artUrl; - - return undefined; + + return artUrl; }); }