From 245ac197112b653193be4672ed9940bfd0c83d0e Mon Sep 17 00:00:00 2001 From: ulrich Date: Fri, 09 Apr 2021 07:52:36 +0000 Subject: [PATCH] ID3 Tags werden bis zur Abspielliste durchgereicht --- src/de/uhilger/mediaz/api/JsonHelper.java | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/de/uhilger/mediaz/api/JsonHelper.java b/src/de/uhilger/mediaz/api/JsonHelper.java index 1c91930..b84c51e 100644 --- a/src/de/uhilger/mediaz/api/JsonHelper.java +++ b/src/de/uhilger/mediaz/api/JsonHelper.java @@ -28,6 +28,7 @@ } public String jsonWithCustomType(Object o, String typeName) { + /* StringBuilder sb = new StringBuilder(); sb.append("{\""); sb.append(typeName); @@ -36,6 +37,21 @@ sb.append(gson.toJson(o)); sb.append("}"); return sb.toString(); + */ + Gson gson = new Gson(); + return embedInCustomType(gson.toJson(o), typeName); + } + + public String embedInCustomType(String jsonStr, String typeName) { + StringBuilder sb = new StringBuilder(); + sb.append("{\""); + sb.append(typeName); + sb.append("\": "); + //Gson gson = new Gson(); + //sb.append(gson.toJson(o)); + sb.append(jsonStr); + sb.append("}"); + return sb.toString(); } } -- Gitblit v1.9.3