len 9 жил өмнө
parent
commit
b8bc3476f4

+ 1 - 2
app/src/main/java/eu/kanade/tachiyomi/event/ReaderEvent.kt

@@ -2,6 +2,5 @@ package eu.kanade.tachiyomi.event
 
 import eu.kanade.tachiyomi.data.database.models.Chapter
 import eu.kanade.tachiyomi.data.database.models.Manga
-import eu.kanade.tachiyomi.data.source.base.Source
 
-class ReaderEvent(val source: Source, val manga: Manga, val chapter: Chapter)
+class ReaderEvent(val manga: Manga, val chapter: Chapter)

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt

@@ -179,7 +179,7 @@ class ChaptersPresenter : BasePresenter<ChaptersFragment>() {
     }
 
     fun onOpenChapter(chapter: Chapter) {
-        EventBus.getDefault().postSticky(ReaderEvent(source, manga, chapter))
+        EventBus.getDefault().postSticky(ReaderEvent(manga, chapter))
     }
 
     fun getNextUnreadChapter(): Chapter? {

+ 2 - 4
app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.java

@@ -48,7 +48,6 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
 
     @State Manga manga;
     @State Chapter activeChapter;
-    @State int sourceId;
     @State int requestedPage;
     private Page currentPage;
     private Source source;
@@ -72,7 +71,7 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
         super.onCreate(savedState);
 
         if (savedState != null) {
-            source = sourceManager.get(sourceId);
+            source = sourceManager.get(manga.source);
             initializeSubjects();
         }
 
@@ -114,8 +113,7 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
     public void onEvent(ReaderEvent event) {
         EventBus.getDefault().removeStickyEvent(event);
         manga = event.getManga();
-        source = event.getSource();
-        sourceId = source.getId();
+        source = sourceManager.get(manga.source);
         initializeSubjects();
         loadChapter(event.getChapter());
         if (prefs.autoUpdateMangaSync()) {

+ 1 - 2
app/src/main/java/eu/kanade/tachiyomi/ui/recent/RecentChaptersPresenter.kt

@@ -250,8 +250,7 @@ class RecentChaptersPresenter : BasePresenter<RecentChaptersFragment>() {
      * @param item chapter that is opened
      */
     fun onOpenChapter(item: MangaChapter) {
-        val source = sourceManager.get(item.manga.source)
-        EventBus.getDefault().postSticky(ReaderEvent(source, item.manga, item.chapter))
+        EventBus.getDefault().postSticky(ReaderEvent(item.manga, item.chapter))
     }
 
     /**