/**
* 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;
/**
* 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;
* @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) {
}
* @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) {
}
* @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) {
}