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/ListFileHandler.java |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/de/uhilger/mediaz/api/ListFileHandler.java b/src/de/uhilger/mediaz/api/ListFileHandler.java
index cb24df1..cb9e9b4 100644
--- a/src/de/uhilger/mediaz/api/ListFileHandler.java
+++ b/src/de/uhilger/mediaz/api/ListFileHandler.java
@@ -25,6 +25,7 @@
 import de.uhilger.mediaz.store.FileStorage;
 import de.uhilger.mediaz.store.Storage;
 import de.uhilger.mediaz.store.StorageFile;
+import de.uhilger.mediaz.store.Track;
 import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -93,6 +94,7 @@
             Object o = extMap.get(ext);
             if(o instanceof String) {
               sf.setTyp(o.toString());
+              getTrack(file, sf);
             } else {
               sf.setTyp(StorageFile.TYP_FILE);
             }
@@ -111,5 +113,13 @@
     }
   }
   
+  private void getTrack(File file, StorageFile sf) {
+    if(sf.getTyp().equalsIgnoreCase(StorageFile.TYP_AUDIO)) {
+      Track track = new Track(file);
+      sf.setInterpret(track.getArtist());
+      sf.setTitelAnzName(track.getTitle());
+      sf.setAlbum(track.getAlbum());
+    }
+  }
   
 }

--
Gitblit v1.9.3