Treat the "mper" attribute as the 64-bit item that it is rather than a 32-bit item as hithereto. Output it as a hexadecimal number to correspond with the format of the track id obtained from AppleScript

This commit is contained in:
Mike Brady
2020-02-18 14:09:43 +00:00
parent 0c3ec38c97
commit 789ba1ee5e
4 changed files with 30 additions and 23 deletions
+2 -2
View File
@@ -25,6 +25,7 @@
*/
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include "config.h"
@@ -174,8 +175,7 @@ void mpris_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)
// Add in the Track ID based on the 'mper' metadata if it is non-zero
if (argc->item_id != 0) {
char trackidstring[128];
snprintf(trackidstring, sizeof(trackidstring), "/org/gnome/ShairportSync/mper_%u",
argc->item_id);
snprintf(trackidstring, sizeof(trackidstring), "/org/gnome/ShairportSync/%" PRIX64 "", argc->item_id);
GVariant *trackid = g_variant_new("o", trackidstring);
g_variant_builder_add(dict_builder, "{sv}", "mpris:trackid", trackid);
}