ソースを参照

Update tracking sites after finishing chapter (#2044)

* Added second updateTrackLastChapterRead() called whenever a chapter has been read in the reader

* Removed old updateTrackLastChapterRead() so that it's not called twice.
Jannis Becker 5 年 前
コミット
15f225537e

+ 3 - 3
app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt

@@ -147,10 +147,9 @@ class ReaderPresenter(
 
     /**
      * Called when the user pressed the back button and is going to leave the reader. Used to
-     * update tracking services and trigger deletion of the downloaded chapters.
+     * trigger deletion of the downloaded chapters.
      */
     fun onBackPressed() {
-        updateTrackLastChapterRead()
         deletePendingChapters()
     }
 
@@ -308,7 +307,7 @@ class ReaderPresenter(
 
     /**
      * Called every time a page changes on the reader. Used to mark the flag of chapters being
-     * read, enqueue downloaded chapter deletion, and updating the active chapter if this
+     * read, update tracking services, enqueue downloaded chapter deletion, and updating the active chapter if this
      * [page]'s chapter is different from the currently active.
      */
     fun onPageSelected(page: ReaderPage) {
@@ -320,6 +319,7 @@ class ReaderPresenter(
         selectedChapter.chapter.last_page_read = page.index
         if (selectedChapter.pages?.lastIndex == page.index) {
             selectedChapter.chapter.read = true
+            updateTrackLastChapterRead()
             enqueueDeleteReadChapters(selectedChapter)
         }