From 03b95f100b605458e5bf2995e955882d9aa51868 Mon Sep 17 00:00:00 2001
From: undisclosed
Date: Mon, 23 Jan 2023 13:28:17 +0000
Subject: [PATCH] URL in m3u berichtigt
---
src/de/uhilger/tango/api/AbstractHandler.java | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/src/de/uhilger/tango/api/AbstractHandler.java b/src/de/uhilger/tango/api/AbstractHandler.java
index 891b06d..d767353 100644
--- a/src/de/uhilger/tango/api/AbstractHandler.java
+++ b/src/de/uhilger/tango/api/AbstractHandler.java
@@ -21,6 +21,9 @@
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import de.uhilger.tango.App;
+import de.uhilger.tango.entity.Einstellung;
+import de.uhilger.tango.entity.Entity;
+import de.uhilger.tango.store.Storage;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@@ -130,7 +133,7 @@
return "nicht unterstuetzt";
}
- protected String post(HttpExchange e) {
+ protected String post(HttpExchange e) throws IOException {
setReturnCode(RTC_NOT_FOUND);
return "nicht unterstuetzt";
}
@@ -155,4 +158,20 @@
return rb.getString(key);
}
+ protected String getEinstellung(Storage s, String key, String standardWert) {
+ Entity entity = s.read(Einstellung.class.getSimpleName(), key);
+ if (entity instanceof Einstellung) {
+ Einstellung einstellung = (Einstellung) entity;
+ Object o = einstellung.getValue();
+ if(o instanceof String) {
+ return o.toString();
+ } else {
+ return standardWert;
+ }
+ } else {
+ return standardWert;
+ }
+ }
+
+
}
--
Gitblit v1.9.3