Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Add playlist URI to JSON output
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnouki committed Jul 22, 2015
1 parent 7eb54cd commit 393ecc0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/commands.c
Expand Up @@ -272,6 +272,9 @@ gboolean list_playlists(command_context* ctx) {
const char* pn;
gchar* pfn;

sp_link* lnk;
gchar uri[1024];

n = playlists_len();
json_builder_set_member_name(ctx->jb, "playlists");
json_builder_begin_array(ctx->jb);
Expand Down Expand Up @@ -326,6 +329,12 @@ gboolean list_playlists(command_context* ctx) {
jb_add_int(ctx->jb, "tracks", t);
json_playlist_offline_status(pl, ctx->jb);
jb_add_int(ctx->jb, "index", i);

lnk = sp_link_create_from_playlist(pl);
if (sp_link_as_string(lnk, uri, 1024) < 1024) {
jb_add_string(ctx->jb, "uri", uri);
}
sp_link_release(lnk);
}
else {
/* Playlist separator */
Expand Down

0 comments on commit 393ecc0

Please sign in to comment.