mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-24 13:10:16 -04:00
Fix for occasional Content Manager Crash
This commit is contained in:
parent
f182b84a5f
commit
4e3303b833
@ -90,7 +90,7 @@ public class BookDao {
|
||||
}
|
||||
|
||||
public void saveBooks(ArrayList<Book> books) {
|
||||
for (Book book : books) {
|
||||
books.stream().filter(book -> book != null).forEach(book -> {
|
||||
BookDatabaseEntity bookDatabaseEntity = new BookDatabaseEntity();
|
||||
bookDatabaseEntity.setBookId(book.getId());
|
||||
bookDatabaseEntity.setTitle(book.getTitle());
|
||||
@ -107,7 +107,7 @@ public class BookDao {
|
||||
String filePath = book.file.getPath();
|
||||
mDb.deleteWhere(BookDatabaseEntity.class, BookDatabaseEntity.URL.eq(filePath));
|
||||
mDb.persist(bookDatabaseEntity);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void saveBook(Book book) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user