Skip to content

Commit

Permalink
add optional json attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
irgendwr committed Sep 29, 2024
1 parent 3e4688a commit b1d3c01
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/base/UWebServer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,19 @@ function TWebServer.GenerateJSONWithSongs: string;
Item.Add('artist', UTF8Encode(Song.Artist));
Item.Add('title', UTF8Encode(Song.Title));
Item.Add('lang', UTF8Encode(Song.Language));
// Item.Add('cover', Song.Path.Append(Song.Cover).ToUTF8);
Item.Add('edition', Edition);
Item.Add('genre', Genre);
Item.Add('year', Year);

if Song.Creator <> '' then
Item.Add('creator', UTF8Encode(Song.Creator));

if Song.isDuet then
Item.Add('duet', True);

if Song.hasRap then
Item.Add('hasRap', True);

JSONSongs.Add(Item);
end;

Expand Down

0 comments on commit b1d3c01

Please sign in to comment.