Persoenliche Mediazentrale
ulrich
2021-05-06 f70acbb491c6421623cca57292a75f1820efad4d
src/de/uhilger/tango/api/MediaSteuerung.java
@@ -79,13 +79,19 @@
  public static final String DEFAULT_HOST = "http://localhost:9090";
  private final Map spielt = new HashMap();
  private String conf;
  public MediaSteuerung(String conf) {
    this.conf = conf;
  }
  @Override
  protected String get(HttpExchange e) {
    String response;
    String path = e.getRequestURI().toString();
    String[] elems = path.split(Server.SLASH);
    FileStorage fs = new FileStorage(App.getInitParameter(App.getRs(App.RB_AP_CONF)));
    FileStorage fs = new FileStorage(conf);
    logger.fine(path);
    
    // Faustregel: Anzahl Elemente eines URL plus 1 ist die Anzahl der Elemente des 
@@ -139,7 +145,7 @@
  private String urlAbspielen(HttpExchange e, String abspielerKmd) throws IOException {
    String path = e.getRequestURI().toString();
    String[] elems = path.split(Server.SLASH);
    FileStorage fs = new FileStorage(App.getInitParameter(App.getRs(App.RB_AP_CONF)));
    FileStorage fs = new FileStorage(conf);
    if(elems[6].equalsIgnoreCase("titel")) {
      String titelJson = bodyLesen(e);
      Gson gson = new Gson();
@@ -150,7 +156,7 @@
        Entity entity = fs.read(FileStorage.ST_ABSPIELER, elems[4]);
        if (entity instanceof Abspieler) {
          Abspieler abspieler = (Abspieler) entity;
          String server = getEinstellung(fs, App.getRs(App.RB_HOST), DEFAULT_HOST);
          String server = getEinstellung(fs, getResString(App.RB_HOST), DEFAULT_HOST);
          String signal = abspielKommando(fs, abspieler, server, titelUrl, abspielerKmd).toString();
          abspielerKommandoSenden(signal);
          return signal + "gesendet.";
@@ -286,7 +292,7 @@
    vorgang.setTitelNr(titelNr);
    spielt.put(abspieler.getName(), vorgang);
    
    String server = getEinstellung(s, App.getRs(App.RB_HOST), DEFAULT_HOST);
    String server = getEinstellung(s, getResString(App.RB_HOST), DEFAULT_HOST);
    /*
@@ -320,7 +326,7 @@
    //kmd.append(PL_CMD_PLAY);
    kmd.append(abspielKmd);
    // Parameter fuer den Abspieler holen
    kmd.append(getEinstellung(s, App.getRs(App.RB_PLAYERPARAMS), PL_DEFAULT_PARAMS));
    kmd.append(getEinstellung(s, getResString(App.RB_PLAYERPARAMS), PL_DEFAULT_PARAMS));
    kmd.append(server);
    kmd.append(titelUrl);