X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix_swing%2Fgui%2Fbook%2FBookInfo.java;h=6859cfab119d9bbecf8b122a8640373b3e6b2b68;hb=f90b89d4d577de935590d8f20179b04a035f45d3;hp=b7dc509f0c423791dd2693774a61aff9021d675a;hpb=3cdf3fd8a60d22a592e1cd0634cb108faa1f5f9f;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix_swing/gui/book/BookInfo.java b/src/be/nikiroo/fanfix_swing/gui/book/BookInfo.java index b7dc509..6859cfa 100644 --- a/src/be/nikiroo/fanfix_swing/gui/book/BookInfo.java +++ b/src/be/nikiroo/fanfix_swing/gui/book/BookInfo.java @@ -122,7 +122,7 @@ public class BookInfo { /** * This item library cache state. * - * @return TRUE if it is present in the {@link GuiReader} cache + * @return TRUE if it is present in the {@link CacheLibrary} cache */ public boolean isCached() { return cached; @@ -131,7 +131,7 @@ public class BookInfo { /** * This item library cache state. * - * @param cached TRUE if it is present in the {@link GuiReader} cache + * @param cached TRUE if it is present in the {@link CacheLibrary} cache */ public void setCached(boolean cached) { this.cached = cached; @@ -234,11 +234,11 @@ public class BookInfo { * @return the book */ static public BookInfo fromSource(BasicLibrary lib, String source) { - BookInfo info = new BookInfo(Type.SOURCE, "source_" + source, source); + BookInfo info = new BookInfo(Type.SOURCE, "source_" + (source == null ? "" : source), source); int size = 0; try { - size = lib.getListBySource(source).size(); + size = lib.getList().filter(source, null, null).size(); } catch (IOException e) { } @@ -261,11 +261,11 @@ public class BookInfo { * @return the book */ static public BookInfo fromAuthor(BasicLibrary lib, String author) { - BookInfo info = new BookInfo(Type.AUTHOR, "author_" + author, author); + BookInfo info = new BookInfo(Type.AUTHOR, "author_" + (author == null ? "" : author), author); int size = 0; try { - size = lib.getListByAuthor(author).size(); + size = lib.getList().filter(null, author, null).size(); } catch (IOException e) { } @@ -288,15 +288,11 @@ public class BookInfo { * @return the book */ static public BookInfo fromTag(BasicLibrary lib, String tag) { - BookInfo info = new BookInfo(Type.TAG, "tag_" + tag, tag); + BookInfo info = new BookInfo(Type.TAG, "tag_" + (tag == null ? "" : tag), tag); int size = 0; try { - for (MetaData meta : lib.getList()) { - if (meta.getTags().contains(tag)) { - size++; - } - } + size = lib.getList().filter(null, null, tag).size(); } catch (IOException e) { }