move isCache/cleanCache to BasicLibrary, improve filter()
[fanfix.git] / src / be / nikiroo / fanfix / library / MetaResultList.java
index 3aa167f99e16e44ce8fd36d51362bfbf3269a029..886defe8b1c6a9df42639f04c82ebd87d5396bbd 100644 (file)
@@ -1,6 +1,7 @@
 package be.nikiroo.fanfix.library;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
@@ -88,6 +89,15 @@ public class MetaResultList {
                return authors;
        }
 
+       // helper
+       public List<MetaData> filter(String source, String author, String tag) {
+               List<String> sources = source == null ? null : Arrays.asList(source);
+               List<String> authors = author == null ? null : Arrays.asList(author);
+               List<String> tags = tag == null ? null : Arrays.asList(tag);
+
+               return filter(sources, authors, tags);
+       }
+
        // null or empty -> no check, rest = must be included
        // source: a source ending in "/" means "this or any source starting with this",
        // i;e., to enable source hierarchy