From 4ed93d9b68910b7482e16049c4e9a897cf346010 Mon Sep 17 00:00:00 2001 From: haruInDisguise Date: Thu, 20 Mar 2025 00:14:31 +0100 Subject: [PATCH] module_mpris: Fixed property parsing on startup --- modules/mpris.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/mpris.c b/modules/mpris.c index df6d6b7..cdf6da8 100644 --- a/modules/mpris.c +++ b/modules/mpris.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -99,8 +100,8 @@ struct private int refresh_abort_fd; size_t timeout_ms; - struct context context; string_array identity_list; + struct context context; struct particle *label; }; @@ -714,7 +715,8 @@ find_existing_clients(struct context *context, sd_bus *connection, uint32_t time } else { /* Process the new clients properties */ client_add(context, client_name, client_uniq_name); - struct client *client = tll_front(context->clients); + struct client *client = tll_back(context->clients); + if (!update_client_from_message(client, props_reply)) { LOG_WARN("Failed to process existing client: %s", client_name); tll_pop_front(context->clients); @@ -749,12 +751,10 @@ context_setup(struct context *context) * the connection is turned into a monitor, since * monitor connections cannot send messages. */ if (find_existing_clients(context, connection, context->mpd_config->timeout_ms)) { - context->current_client = tll_front(context->clients); + context->current_client = tll_back(context->clients); LOG_INFO("Selecting last registered client: %s", context->current_client->bus_name); } - context->monitor_connection = connection; - /* Turn this connection into a monitor */ sd_bus_message *message = NULL; status = sd_bus_message_new_method_call(connection, &message, DBUS_SERVICE, DBUS_PATH, DBUS_INTERFACE_MONITORING,