diff --git a/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BookManager.java b/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BookManager.java index b1b0e92..28a17bc 100644 --- a/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BookManager.java +++ b/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BookManager.java @@ -3,12 +3,16 @@ package org.bspeice.minimalbible.activity.viewer; import org.crosswire.jsword.book.Book; import org.crosswire.jsword.book.Books; +import java.util.ArrayList; +import java.util.List; + import javax.inject.Inject; import javax.inject.Singleton; import rx.Observable; import rx.functions.Action0; import rx.functions.Action1; +import rx.functions.Func1; import rx.schedulers.Schedulers; /** @@ -20,10 +24,22 @@ public class BookManager { private Observable installedBooks; private Boolean refreshComplete; + // Some of these books seem to think they're installed... + private List excludeBooks = new ArrayList() {{ + add("ERen_no"); + add("ot1nt2"); + }}; + @Inject BookManager() { // TODO: Any way this can be sped up goes straight to the initialization time. installedBooks = Observable.from(Books.installed().getBooks()) + .filter(new Func1() { + @Override + public Boolean call(Book book) { + return !excludeBooks.contains(book.getInitials()); + } + }) .cache(); installedBooks.subscribeOn(Schedulers.io()) .subscribe(new Action1() {