some update/refresh fixes
[fanfix.git] / src / be / nikiroo / fanfix_swing / gui / BooksPanel.java
index 73de77e974d7e6e313489ffb3b17ba969c1540b5..04ee86fce036602c9e15962f463b4eabc1270049 100644 (file)
@@ -129,7 +129,7 @@ public class BooksPanel extends ListenerPanel {
                        protected List<BookInfo> doInBackground() throws Exception {
                                List<BookInfo> bookInfos = new ArrayList<BookInfo>();
                                BasicLibrary lib = Instance.getInstance().getLibrary();
-                               for (MetaData meta : lib.getList(null).filter(sources, authors, tags)) {
+                               for (MetaData meta : lib.getList().filter(sources, authors, tags)) {
                                        bookInfos.add(BookInfo.fromMeta(lib, meta));
                                }
 
@@ -164,7 +164,8 @@ public class BooksPanel extends ListenerPanel {
        private void filter(String filter) {
                data.clear();
                for (BookInfo bookInfo : bookInfos) {
-                       if (filter.isEmpty() || bookInfo.getMainInfo().toLowerCase().contains(filter.toLowerCase())) {
+                       if (bookInfo.getMainInfo() == null || filter.isEmpty()
+                                       || bookInfo.getMainInfo().toLowerCase().contains(filter.toLowerCase())) {
                                data.addElement(bookInfo);
                        }
                }
@@ -232,6 +233,7 @@ public class BooksPanel extends ListenerPanel {
 
                        @Override
                        public void invalidateCache() {
+                               // TODO: also reset the popup menu for sources/author
                                fireActionPerformed(INVALIDATE_CACHE);
                        }
                });