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/ListHandler.java |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/de/uhilger/mediaz/api/ListHandler.java b/src/de/uhilger/mediaz/api/ListHandler.java
index 84a9056..b947f5e 100644
--- a/src/de/uhilger/mediaz/api/ListHandler.java
+++ b/src/de/uhilger/mediaz/api/ListHandler.java
@@ -49,11 +49,9 @@
     String path = e.getRequestURI().toString();
     String[] elems = path.split(App.getRs(Server.RB_SLASH));
     String plname = elems[elems.length - 1];
-    logger.finer("GET plname: " + plname);
     FileStorage fs = new FileStorage(App.getInitParameter(App.getRs(App.RB_AP_CONF)));
     String json = fs.readJson(FileStorage.ST_ABSPIELLISTE, plname);
-    logger.finer("PL json: " + json);
-    return json;
+    return embedInCustomType(json, FileStorage.ST_ABSPIELLISTE);
   }
 
   @Override
@@ -61,12 +59,8 @@
     String path = e.getRequestURI().toString();
     String[] elems = path.split(App.getRs(Server.RB_SLASH));
     String response = "ListHandler.put: ungueltiger URL";
-    logger.finer("elems.length: " + elems.length);
-    for(String elem : elems) {
-      logger.finer("elem: " + elem);
-    }
     switch(elems.length) {
-      case 5:
+      case 5: // ohne nr am Ende
         response = addTitel(e, elems[4]);
         break;
         
@@ -78,16 +72,12 @@
   }
   
   private String addTitel(HttpExchange e, String plname) throws IOException {
-    //String plname = elems[elems.length - 1];
-    logger.finer("plname: " + plname);
     FileStorage fs = new FileStorage(App.getInitParameter(App.getRs(App.RB_AP_CONF)));
     Entity entity = fs.read(FileStorage.ST_ABSPIELLISTE, plname);
     String response = "Titel konnte nicht hinzugefuegt werden.";
     if(entity instanceof Abspielliste) {
       Abspielliste aliste = (Abspielliste) entity;
-      logger.finer("aliste: " + aliste.getName());
       String titelJson = bodyLesen(e);
-      logger.finer("titelJson: " + titelJson);
       Gson gson = new Gson();
       Object o = gson.fromJson(titelJson, fs.typeFromName(Titel.class.getSimpleName()).getType());
       if(o instanceof Titel) {

--
Gitblit v1.9.3