瀏覽代碼

preparations for a "last played" list

LH 9 年之前
父節點
當前提交
f95c3e6c26
共有 1 個文件被更改,包括 19 次插入0 次删除
  1. 19 0
      iZpl/src/main/java/de/nplusc/izc/iZpl/PlProcessorV2.java

+ 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;
+    }
+    
 }