mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-17 11:09:19 +01:00
Upgrade StorIO to 1.8.0
This commit is contained in:
parent
dda0c50a1c
commit
416fd128ba
@ -81,7 +81,7 @@ dependencies {
|
||||
final SUPPORT_LIBRARY_VERSION = '23.1.1'
|
||||
final DAGGER_VERSION = '2.0.2'
|
||||
final MOCKITO_VERSION = '1.10.19'
|
||||
final STORIO_VERSION = '1.7.0'
|
||||
final STORIO_VERSION = '1.8.0'
|
||||
final ICEPICK_VERSION = '3.1.0'
|
||||
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
@ -63,7 +63,7 @@ public class UpdateMangaSyncService extends Service {
|
||||
subscriptions.add(Observable.defer(() -> sync.update(mangaSync))
|
||||
.flatMap(response -> {
|
||||
if (response.isSuccessful()) {
|
||||
return db.insertMangaSync(mangaSync).createObservable();
|
||||
return db.insertMangaSync(mangaSync).asRxObservable();
|
||||
}
|
||||
return Observable.error(new Exception("Could not update MAL"));
|
||||
})
|
||||
|
@ -70,12 +70,12 @@ public class LibraryPresenter extends BasePresenter<LibraryFragment> {
|
||||
}
|
||||
|
||||
private Observable<List<Category>> getCategoriesObservable() {
|
||||
return db.getCategories().createObservable()
|
||||
return db.getCategories().asRxObservable()
|
||||
.doOnNext(categories -> this.categories = categories);
|
||||
}
|
||||
|
||||
private Observable<Map<Integer, List<Manga>>> getLibraryMangasObservable() {
|
||||
return db.getLibraryMangas().createObservable()
|
||||
return db.getLibraryMangas().asRxObservable()
|
||||
.flatMap(mangas -> Observable.from(mangas)
|
||||
.groupBy(manga -> manga.category)
|
||||
.flatMap(group -> group.toList()
|
||||
|
@ -24,7 +24,7 @@ public class CategoryPresenter extends BasePresenter<CategoryActivity> {
|
||||
super.onCreate(savedState);
|
||||
|
||||
restartableLatestCache(GET_CATEGORIES,
|
||||
() -> db.getCategories().createObservable()
|
||||
() -> db.getCategories().asRxObservable()
|
||||
.doOnNext(categories -> this.categories = categories)
|
||||
.observeOn(AndroidSchedulers.mainThread()),
|
||||
CategoryActivity::setCategories);
|
||||
@ -46,11 +46,11 @@ public class CategoryPresenter extends BasePresenter<CategoryActivity> {
|
||||
}
|
||||
cat.order = max;
|
||||
|
||||
db.insertCategory(cat).createObservable().subscribe();
|
||||
db.insertCategory(cat).asRxObservable().subscribe();
|
||||
}
|
||||
|
||||
public void deleteCategories(List<Category> categories) {
|
||||
db.deleteCategories(categories).createObservable().subscribe();
|
||||
db.deleteCategories(categories).asRxObservable().subscribe();
|
||||
}
|
||||
|
||||
public void reorderCategories(List<Category> categories) {
|
||||
@ -58,11 +58,11 @@ public class CategoryPresenter extends BasePresenter<CategoryActivity> {
|
||||
categories.get(i).order = i;
|
||||
}
|
||||
|
||||
db.insertCategories(categories).createObservable().subscribe();
|
||||
db.insertCategories(categories).asRxObservable().subscribe();
|
||||
}
|
||||
|
||||
public void renameCategory(Category category, String name) {
|
||||
category.name = name;
|
||||
db.insertCategory(category).createObservable().subscribe();
|
||||
db.insertCategory(category).asRxObservable().subscribe();
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class MangaPresenter extends BasePresenter<MangaActivity> {
|
||||
}
|
||||
|
||||
private Observable<Manga> getDbMangaObservable() {
|
||||
return db.getManga(mangaId).createObservable()
|
||||
return db.getManga(mangaId).asRxObservable()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext(manga -> EventBus.getDefault().postSticky(manga));
|
||||
|
@ -97,7 +97,7 @@ public class ChaptersPresenter extends BasePresenter<ChaptersFragment> {
|
||||
source = sourceManager.get(manga.source);
|
||||
start(DB_CHAPTERS);
|
||||
|
||||
add(db.getChapters(manga).createObservable()
|
||||
add(db.getChapters(manga).asRxObservable()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.doOnNext(chapters -> {
|
||||
this.chapters = chapters;
|
||||
@ -202,7 +202,7 @@ public class ChaptersPresenter extends BasePresenter<ChaptersFragment> {
|
||||
return chapter;
|
||||
})
|
||||
.toList()
|
||||
.flatMap(chapters -> db.insertChapters(chapters).createObservable())
|
||||
.flatMap(chapters -> db.insertChapters(chapters).asRxObservable())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe());
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class MyAnimeListPresenter extends BasePresenter<MyAnimeListFragment> {
|
||||
myAnimeList = syncManager.getMyAnimeList();
|
||||
|
||||
restartableLatestCache(GET_MANGA_SYNC,
|
||||
() -> db.getMangaSync(manga, myAnimeList).createObservable()
|
||||
() -> db.getMangaSync(manga, myAnimeList).asRxObservable()
|
||||
.doOnNext(mangaSync -> this.mangaSync = mangaSync)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread()),
|
||||
@ -75,7 +75,7 @@ public class MyAnimeListPresenter extends BasePresenter<MyAnimeListFragment> {
|
||||
}
|
||||
return Observable.error(new Exception("Could not find manga"));
|
||||
})
|
||||
.flatMap(myManga -> db.insertMangaSync(myManga).createObservable())
|
||||
.flatMap(myManga -> db.insertMangaSync(myManga).asRxObservable())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread()),
|
||||
(view, result) -> view.onRefreshDone(),
|
||||
@ -109,7 +109,7 @@ public class MyAnimeListPresenter extends BasePresenter<MyAnimeListFragment> {
|
||||
|
||||
private void updateRemote() {
|
||||
add(myAnimeList.update(mangaSync)
|
||||
.flatMap(response -> db.insertMangaSync(mangaSync).createObservable())
|
||||
.flatMap(response -> db.insertMangaSync(mangaSync).asRxObservable())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(next -> {},
|
||||
@ -139,7 +139,7 @@ public class MyAnimeListPresenter extends BasePresenter<MyAnimeListFragment> {
|
||||
add(myAnimeList.bind(manga)
|
||||
.flatMap(response -> {
|
||||
if (response.isSuccessful()) {
|
||||
return db.insertMangaSync(manga).createObservable();
|
||||
return db.insertMangaSync(manga).asRxObservable();
|
||||
}
|
||||
return Observable.error(new Exception("Could not bind manga"));
|
||||
})
|
||||
|
@ -172,8 +172,8 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
|
||||
|
||||
private Observable<Pair<Chapter, Chapter>> getAdjacentChaptersObservable() {
|
||||
return Observable.zip(
|
||||
db.getPreviousChapter(chapter).createObservable().take(1),
|
||||
db.getNextChapter(chapter).createObservable().take(1),
|
||||
db.getPreviousChapter(chapter).asRxObservable().take(1),
|
||||
db.getNextChapter(chapter).asRxObservable().take(1),
|
||||
Pair::create)
|
||||
.doOnNext(pair -> {
|
||||
previousChapter = pair.first;
|
||||
@ -211,7 +211,7 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
|
||||
}
|
||||
|
||||
private Observable<List<MangaSync>> getMangaSyncObservable() {
|
||||
return db.getMangasSync(manga).createObservable()
|
||||
return db.getMangasSync(manga).asRxObservable()
|
||||
.doOnNext(mangaSync -> this.mangaSyncList = mangaSync);
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
|
||||
if (isChapterFinished()) {
|
||||
chapter.read = true;
|
||||
}
|
||||
db.insertChapter(chapter).createObservable().subscribe();
|
||||
db.insertChapter(chapter).asRxObservable().subscribe();
|
||||
}
|
||||
|
||||
// Check whether the chapter has been read
|
||||
|
@ -47,7 +47,6 @@ public class WebtoonAdapter extends RecyclerView.Adapter<WebtoonHolder> {
|
||||
|
||||
public void setPages(List<Page> pages) {
|
||||
this.pages = pages;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
|
@ -107,9 +107,8 @@ public class WebtoonReader extends BaseReader {
|
||||
if (pages != null) {
|
||||
unsubscribeStatus();
|
||||
recycler.clearOnScrollListeners();
|
||||
adapter.clear();
|
||||
recycler.scrollTo(0, 0);
|
||||
adapter.setPages(pages);
|
||||
recycler.setAdapter(adapter);
|
||||
setScrollListener();
|
||||
observeStatus(0);
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ public class RecentChaptersAdapter extends FlexibleAdapter<RecyclerView.ViewHold
|
||||
case SECTION:
|
||||
final Date date = (Date) getItem(position);
|
||||
((SectionViewHolder) holder).onSetValues(date);
|
||||
break;
|
||||
}
|
||||
|
||||
//When user scrolls this bind the correct selection status
|
||||
|
@ -42,7 +42,7 @@ public class RecentChaptersPresenter extends BasePresenter<RecentChaptersFragmen
|
||||
}
|
||||
|
||||
private Observable<List<Object>> getRecentChaptersObservable() {
|
||||
return db.getRecentChapters().createObservable()
|
||||
return db.getRecentChapters().asRxObservable()
|
||||
// group chapters by the date they were fetched on a ordered map
|
||||
.flatMap(recents -> Observable.from(recents)
|
||||
.toMultimap(
|
||||
|
Loading…
Reference in New Issue
Block a user