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/entity/Titel.java  |   28 +++++++++++--
 www/ui/js/app.js                         |   31 +++++++++++++--
 www/ui/data/tpl/titel_liste.tpl          |    2 
 www/ui/data/tpl/katalog_inhalt_liste.tpl |    3 +
 4 files changed, 53 insertions(+), 11 deletions(-)

diff --git a/src/de/uhilger/mediaz/entity/Titel.java b/src/de/uhilger/mediaz/entity/Titel.java
index 163d0b8..775b3d1 100644
--- a/src/de/uhilger/mediaz/entity/Titel.java
+++ b/src/de/uhilger/mediaz/entity/Titel.java
@@ -25,7 +25,9 @@
   private String katalogUrl;
   private String pfad;
   private String name;
-  private String anzName;
+  private String interpret = "";
+  private String titelAnzName = "";
+  private String album  = "";
 
   public String getKatalogUrl() {
     return katalogUrl;
@@ -51,12 +53,28 @@
     this.pfad = pfad;
   }
 
-  public String getAnzName() {
-    return anzName;
+  public String getInterpret() {
+    return interpret;
   }
 
-  public void setAnzName(String anzName) {
-    this.anzName = anzName;
+  public void setInterpret(String interpret) {
+    this.interpret = interpret;
+  }
+
+  public String getTitelAnzName() {
+    return titelAnzName;
+  }
+
+  public void setTitelAnzName(String titelAnzName) {
+    this.titelAnzName = titelAnzName;
+  }
+
+  public String getAlbum() {
+    return album;
+  }
+
+  public void setAlbum(String album) {
+    this.album = album;
   }
   
 }
diff --git a/www/ui/data/tpl/katalog_inhalt_liste.tpl b/www/ui/data/tpl/katalog_inhalt_liste.tpl
index f565bd7..0bbda60 100644
--- a/www/ui/data/tpl/katalog_inhalt_liste.tpl
+++ b/www/ui/data/tpl/katalog_inhalt_liste.tpl
@@ -5,7 +5,8 @@
   </div>
   <ul class='entity-liste'>
     {{#Medialiste}}
-    <li class='entity-eintrag entity-typ-{{typ}}'>{{name}}</li>
+    <li class='entity-eintrag entity-typ-{{typ}}' 
+        interpret='{{interpret}}' album='{{album}}' titelAnzName='{{titelAnzName}}'>{{name}}</li>
     {{/Medialiste}}
   </ul>
 </div>
diff --git a/www/ui/data/tpl/titel_liste.tpl b/www/ui/data/tpl/titel_liste.tpl
index d0cc049..b233c09 100644
--- a/www/ui/data/tpl/titel_liste.tpl
+++ b/www/ui/data/tpl/titel_liste.tpl
@@ -6,7 +6,7 @@
   </div>
   <ul class='entity-liste'>
     {{#titel}}
-    <li class='entity-eintrag'>{{name}}</li>
+    <li class='entity-eintrag'>{{interpret}}: {{titelAnzName}}</li>
     {{/titel}}
   </ul>
 </div>
diff --git a/www/ui/js/app.js b/www/ui/js/app.js
index abd781f..6b62511 100644
--- a/www/ui/js/app.js
+++ b/www/ui/js/app.js
@@ -176,13 +176,33 @@
     }
   };
   
+  /*
+
+        {"Medialiste": [{"name":"sound_city.m4v","typ":"video","interpret":"","titelAnzName":"","album":""},{"name":"sub","typ":"folder","interpret":"","titelAnzName":"","album":""},{"name":"Aufnahmen.ods","typ":"file","interpret":"","titelAnzName":"","album":""},{"name":"index.html","typ":"file","interpret":"","titelAnzName":"","album":""},{"name":"A","typ":"folder","interpret":"","titelAnzName":"","album":""},{"name":"sleepers.m4v","typ":"video","interpret":"","titelAnzName":"","album":""}]}
+
+
+        function Titel(n, p, u, i, t, a) {
+          this.katalogUrl = u;
+          this.pfad = p;
+          this.name = n;
+          this.interpret = i;
+          this.titelAnzName = t;
+          this.album  = a;
+        }
+
+   */
+  
   this.addSelectedTitel = function() {
-    var titelName = document.querySelector(".selected").textContent;
+    var elem = document.querySelector(".selected");
+    var titelName = elem.textContent;
+    var album = elem.attributes.album.nodeValue;
+    var interpret = elem.attributes.interpret.nodeValue;
+    var anzName = elem.attributes.titelAnzName.nodeValue;
     var titel;
     if(self.mediaPfad.endsWith('/')) {
-      titel = new Titel(titelName, self.mediaPfad, self.ortPfad);
+      titel = new Titel(titelName, self.mediaPfad, self.ortPfad, interpret, anzName, album);
     } else {
-      titel = new Titel(titelName, self.mediaPfad + '/', self.ortPfad);
+      titel = new Titel(titelName, self.mediaPfad + '/', self.ortPfad, interpret, anzName, album);
     }
     var plname = document.querySelector('#playlist').value;
     self.http_put('../api/alist/' + plname, JSON.stringify(titel), function(responseText) {
@@ -711,8 +731,11 @@
   this.name = n;
 }
 
-function Titel(n, p, u) {
+function Titel(n, p, u, i, t, a) {
   this.katalogUrl = u;
   this.pfad = p;
   this.name = n;
+  this.interpret = i;
+  this.titelAnzName = t;
+  this.album  = a;
 }
\ No newline at end of file

--
Gitblit v1.9.3