DEBUG hvmpd_latest
authorHugo Villeneuve <hugo@hugovil.com>
Sat, 7 Jan 2023 00:32:33 +0000 (19:32 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Sat, 7 Jan 2023 00:33:26 +0000 (19:33 -0500)
src/mpd_client.c

index 586f4f2..bc1c467 100644 (file)
@@ -77,6 +77,8 @@ int callback_mpd(struct mg_connection *c) {
         cmd_id != MPD_API_GET_MPDHOST && cmd_id != MPD_API_SET_MPDPASS)
         return MG_TRUE;
 
+    printf("API: \"%s\"\n", c->content);
+
     switch (cmd_id) {
         case MPD_API_AUTHORIZE:
             p_charbuf = strdup(c->content);
@@ -238,6 +240,7 @@ int callback_mpd(struct mg_connection *c) {
 
             free(p_charbuf);
             p_charbuf = strdup(c->content);
+            printf("  PLAYLIST NAME = %s\n", get_arg2(p_charbuf));
             n = mpd_put_playlist(mpd.buf, get_arg2(p_charbuf), uint_buf);
         out_playlist:
             free(p_charbuf);
@@ -770,6 +773,8 @@ int mpd_put_browse(char *buffer, char *path, unsigned int offset) {
 
             case MPD_ENTITY_TYPE_PLAYLIST:
                 pl = mpd_entity_get_playlist(entity);
+               printf("playlist: %s\n",
+                      mpd_playlist_get_path(pl));
                 cur += json_emit_raw_str(cur, end - cur, "{\"type\":\"playlist\",\"plist\":");
                 cur += json_emit_quoted_str(cur, end - cur, mpd_playlist_get_path(pl));
                 cur += json_emit_raw_str(cur, end - cur, "},");