mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 02:39:23 +02:00
series trees on-the-fly
This commit is contained in:
parent
04f64f3d81
commit
454bd46593
11 changed files with 229 additions and 53 deletions
|
@ -147,7 +147,29 @@ public class BookCollectionShadow extends AbstractBookCollection implements Serv
|
|||
}
|
||||
}
|
||||
|
||||
public synchronized List<Book> books(String pattern) {
|
||||
public synchronized List<Book> booksForSeries(String series) {
|
||||
if (myInterface == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
try {
|
||||
return SerializerUtil.deserializeBookList(myInterface.booksForSeries(series));
|
||||
} catch (RemoteException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized List<Book> booksForTitlePrefix(String prefix) {
|
||||
if (myInterface == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
try {
|
||||
return SerializerUtil.deserializeBookList(myInterface.booksForTitlePrefix(prefix));
|
||||
} catch (RemoteException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized List<Book> booksForPattern(String pattern) {
|
||||
if (myInterface == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
@ -245,16 +267,25 @@ public class BookCollectionShadow extends AbstractBookCollection implements Serv
|
|||
}
|
||||
}
|
||||
|
||||
public synchronized boolean hasSeries() {
|
||||
if (myInterface != null) {
|
||||
try {
|
||||
return myInterface.hasSeries();
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public synchronized List<String> series() {
|
||||
if (myInterface == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//try {
|
||||
// TODO: implement
|
||||
try {
|
||||
return myInterface.series();
|
||||
} catch (RemoteException e) {
|
||||
return Collections.emptyList();
|
||||
//} catch (RemoteException e) {
|
||||
// return Collections.emptyList();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized boolean saveBook(Book book, boolean force) {
|
||||
|
|
|
@ -12,6 +12,8 @@ interface LibraryInterface {
|
|||
List<String> books();
|
||||
List<String> booksForAuthor(in String author);
|
||||
List<String> booksForTag(in String tag);
|
||||
List<String> booksForSeries(in String series);
|
||||
List<String> booksForTitlePrefix(in String prefix);
|
||||
List<String> booksForPattern(in String pattern);
|
||||
List<String> recentBooks();
|
||||
List<String> favorites();
|
||||
|
@ -20,6 +22,7 @@ interface LibraryInterface {
|
|||
String getRecentBook(in int index);
|
||||
|
||||
List<String> authors();
|
||||
boolean hasSeries();
|
||||
List<String> series();
|
||||
List<String> tags();
|
||||
|
||||
|
|
|
@ -127,8 +127,16 @@ public class LibraryService extends Service {
|
|||
return SerializerUtil.serializeBookList(myCollection.books(Util.stringToTag(tag)));
|
||||
}
|
||||
|
||||
public List<String> booksForSeries(String series) {
|
||||
return SerializerUtil.serializeBookList(myCollection.booksForSeries(series));
|
||||
}
|
||||
|
||||
public List<String> booksForTitlePrefix(String prefix) {
|
||||
return SerializerUtil.serializeBookList(myCollection.booksForTitlePrefix(prefix));
|
||||
}
|
||||
|
||||
public List<String> booksForPattern(String pattern) {
|
||||
return SerializerUtil.serializeBookList(myCollection.books(pattern));
|
||||
return SerializerUtil.serializeBookList(myCollection.booksForPattern(pattern));
|
||||
}
|
||||
|
||||
public List<String> recentBooks() {
|
||||
|
@ -160,6 +168,10 @@ public class LibraryService extends Service {
|
|||
return strings;
|
||||
}
|
||||
|
||||
public boolean hasSeries() {
|
||||
return myCollection.hasSeries();
|
||||
}
|
||||
|
||||
public List<String> series() {
|
||||
return myCollection.series();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue