Repository navigation
mpris: set xesam:url tag - #1439
Closed
LunaPresent wants to merge 1 commit into
Closed
LunaPresent wants to merge 1 commit into
LunaPresent wants to merge 1 commit into
Conversation
pgaskin
requested changes
Aug 3, 2025
Comment on lines
+436
to
+441
| const char prefix[] = "file://"; | ||
| char corrected[sizeof(prefix) - 1 + u_str_print_size(ti->filename)]; | ||
| memcpy(corrected, prefix, sizeof(prefix) - 1); | ||
| u_to_utf8(corrected + sizeof(prefix) - 1, ti->filename); | ||
| CK(mpris_msg_append_sas_dict(reply, | ||
| "xesam:url", corrected)); |
Member
Member
There was a problem hiding this comment.
Yeah, it definitely needs URL escaping; playerctl and KDE depend on it, and most other players escape it too.
Closed
pgaskin
requested changes
Sep 24, 2026
pgaskin
left a comment
Member
There was a problem hiding this comment.
I checked some other MPRIS implementations and added a few comments.
In addition, we should use the original string and not do additional normalization before encoding it.
Also, this doesn't handle cdda and cue URLs, but tha can be done separately.
Comment on lines
+436
to
+441
| const char prefix[] = "file://"; | ||
| char corrected[sizeof(prefix) - 1 + u_str_print_size(ti->filename)]; | ||
| memcpy(corrected, prefix, sizeof(prefix) - 1); | ||
| u_to_utf8(corrected + sizeof(prefix) - 1, ti->filename); | ||
| CK(mpris_msg_append_sas_dict(reply, | ||
| "xesam:url", corrected)); |
Member
There was a problem hiding this comment.
Yeah, it definitely needs URL escaping; playerctl and KDE depend on it, and most other players escape it too.
| char corrected[sizeof(prefix) - 1 + u_str_print_size(ti->filename)]; | ||
| memcpy(corrected, prefix, sizeof(prefix) - 1); | ||
| u_to_utf8(corrected + sizeof(prefix) - 1, ti->filename); | ||
| CK(mpris_msg_append_sas_dict(reply, |
Member
|
I am going to reimplement this from scratch myself. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes cmus set the xesam:url tag as described in the mpris spec. This makes it easier for external scripts and applications to interact with the currently playing song, e.g. finding the matching .lrc file.