Prechádzať zdrojové kódy

preparations for a "last played" list

LH 9 rokov pred
rodič
commit
f95c3e6c26

+ 19 - 0
iZpl/src/main/java/de/nplusc/izc/iZpl/PlProcessorV2.java

@@ -45,6 +45,9 @@ public class PlProcessorV2 implements HttpHandler
     private String path;
     private List<String> availEtrs;
     private List<PlayListItem> forceList;
+    private List<PlayListItem> history = new ArrayList<>();
+
+
     
     /* public PlProcessor(String PlPath)
     {
@@ -286,6 +289,11 @@ public class PlProcessorV2 implements HttpHandler
             response=forceList.get(0);
             forceList.remove(0);
         }
+        history.add(response);
+        if(history.size()>1000)
+        {
+            history.remove(0);
+        }
         return response;
     }
     
@@ -307,5 +315,16 @@ public class PlProcessorV2 implements HttpHandler
     {
         return availEtrs.size();
     }
+    
+    public List<PlayListItem> getHistory()
+    {
+        return history;
+    }
+
+    public void setHistory(List<PlayListItem> history)
+    {
+        this.history = history;
+    }
+    
 }