Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] support mpris caching for data uris #177

Open
danielwerg opened this issue Dec 13, 2024 · 1 comment
Open

[feature request] support mpris caching for data uris #177

danielwerg opened this issue Dec 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@danielwerg
Copy link
Contributor

Describe the bug

mpris lib fails when fed base64 art_url

To Reproduce

  1. Install https://github.com/hoyon/mpv-mpris or https://github.com/eNV25/mpv-mpris2
  2. Play track that has art_url with mpv
  3. See
player.vala:539: Failed to cache cover art with url "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAXAAsDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAMG/8QAFhABAQEAAAAAAAAAAAAAAAAAABIR/8QAFQEBAQAAAAAAAAAAAAAAAAAAAgb/xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAwDAQACEQMRAD8Az1FJUUqqmIlpoAT/2Q==": The specified location is not supported

For testing purposes I was using data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAXAAsDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAMG/8QAFhABAQEAAAAAAAAAAAAAAAAAABIR/8QAFQEBAQAAAAAAAAAAAAAAAAAAAgb/xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAwDAQACEQMRAD8Az1FJUUqqmIlpoAT/2Q==

Expected behavior

Cache base64 or let user handle it

const coverArt = bind(player, 'coverArt').as(coverArt => {
  return coverArt ? coverArt : `${SRC}/fallback`; // won't work
});

Additional context

https://github.com/Aylur/astal/blob/main/lib/mpris/player.vala#L539

hoyon/mpv-mpris#111 eNV25/mpv-mpris2#72

@danielwerg danielwerg added the bug Something isn't working label Dec 13, 2024
@Aylur
Copy link
Owner

Aylur commented Dec 13, 2024

Currently it only supports uri schemes that Gio.File supports which is only file and http I think

@Aylur Aylur changed the title Failed to cache cover art with url (base64 art_url) [feature request] support mpris caching for data uris Dec 13, 2024
@Aylur Aylur added enhancement New feature or request and removed bug Something isn't working labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants