Skip to content

Commit

Permalink
Get rid of \n and whitespaces in json output
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyKishenin committed Nov 10, 2014
1 parent c276fef commit d07925d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,5 @@ Just follow [the link](https://developer.gracenote.com/) and get it there.
If everything is fine, you should see the followuing output:

```bash
{
'artist': 'Wilco',
'album': 'A Ghost is Born',
'title': 'Hummingbird'
}
{"artist": "Wilco", "album": "A Ghost is Born", "title": "Hummingbird"}
```
10 changes: 5 additions & 5 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ _display_track_gdo(
// printf("%s\n", track_gdo);

/* Begin json structure */
printf("{ \n");
printf("{");

/* track GNID */
// error = gnsdk_manager_gdo_value_get( track_gdo, GNSDK_GDO_VALUE_GNID, 1, &value );
Expand Down Expand Up @@ -619,7 +619,7 @@ _display_track_gdo(
error = gnsdk_manager_gdo_value_get( title_gdo, GNSDK_GDO_VALUE_DISPLAY, 1, &value );
if (GNSDK_SUCCESS == error)
{
printf( " '%s': '%s', \n", "artist", value );
printf( "\"%s\": \"%s\", ", "artist", value );
}
else
{
Expand Down Expand Up @@ -648,7 +648,7 @@ _display_track_gdo(
error = gnsdk_manager_gdo_value_get( title_gdo, GNSDK_GDO_VALUE_DISPLAY, 1, &value );
if (GNSDK_SUCCESS == error)
{
printf( " '%s': '%s', \n", "album", value );
printf( "\"%s\": \"%s\", ", "album", value );
}
else
{
Expand All @@ -674,7 +674,7 @@ _display_track_gdo(
error = gnsdk_manager_gdo_value_get( title_gdo, GNSDK_GDO_VALUE_DISPLAY, 1, &value );
if (GNSDK_SUCCESS == error)
{
printf( " '%s': '%s'", "title", value ); // Includes end json structure
printf( "\"%s\": \"%s\"", "title", value ); // Includes end json structure
}
else
{
Expand Down Expand Up @@ -708,7 +708,7 @@ _display_track_gdo(
// _display_error(__LINE__, "gnsdk_manager_gdo_child_get()", error);
// }

printf("\n}\n");
printf("}");
/* End json structure */
// printf("}");
}
Expand Down

0 comments on commit d07925d

Please sign in to comment.