diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt index baceda17d207..3d2d7fc19e55 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt @@ -52,19 +52,12 @@ class ChapterHolder( val showPagesLeft = !chapter.read && chapter.last_page_read > 0 && !isLocked - if (showPagesLeft && chapter.pages_left > 0) { - statuses.add( - itemView.resources.getQuantityString( - R.plurals.pages_left, - chapter.pages_left, - chapter.pages_left, - ), - ) - } else if (showPagesLeft) { + if (showPagesLeft) { statuses.add( itemView.context.getString( - R.string.page_, + R.string.page_x_of_y, chapter.last_page_read + 1, + chapter.pages_left + chapter.last_page_read, ), ) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt index 510f792ddcf4..b32142fe717f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt @@ -477,17 +477,17 @@ class ReaderViewModel( val currentChapters = state.value.viewerChapters ?: return val selectedChapter = page.chapter + val pages = selectedChapter.pages ?: return // Save last page read and mark as read if needed selectedChapter.chapter.last_page_read = page.index - selectedChapter.chapter.pages_left = - (selectedChapter.pages?.size ?: page.index) - page.index + selectedChapter.chapter.pages_left = pages.size - page.index val shouldTrack = !preferences.incognitoMode().get() || hasTrackers if (shouldTrack && // For double pages, check if the second to last page is doubled up ( - (selectedChapter.pages?.lastIndex == page.index && page.firstHalf != true) || - (hasExtraPage && selectedChapter.pages?.lastIndex?.minus(1) == page.index) + (pages.lastIndex == page.index && page.firstHalf != true) || + (hasExtraPage && pages.lastIndex.minus(1) == page.index) ) ) { selectedChapter.chapter.read = true @@ -501,7 +501,6 @@ class ReaderViewModel( setReadStartTime() scope.launch { loadNewChapter(selectedChapter) } } - val pages = page.chapter.pages ?: return val inDownloadRange = page.number.toDouble() / pages.size > 0.2 if (inDownloadRange) { downloadNextChapters() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaHolder.kt index eda65eddcde5..e9d7c6308864 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaHolder.kt @@ -201,10 +201,10 @@ class RecentMangaHolder( } item.chapter.id != item.mch.chapter.id -> readLastText(!moreVisible) item.chapter.pages_left > 0 && !item.chapter.read -> context.timeSpanFromNow(R.string.read_, item.mch.history.last_read) + - "\n" + itemView.resources.getQuantityString( - R.plurals.pages_left, - item.chapter.pages_left, - item.chapter.pages_left, + "\n" + itemView.context.getString( + R.string.page_x_of_y, + item.last_page_read + 1, + item.pages_left + item.last_page_read, ) else -> context.timeSpanFromNow(R.string.read_, item.mch.history.last_read) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index adf68e0fd28a..1f090ba43fc0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -51,6 +51,7 @@ Last read Chapter %1$s Chapter %1$s Chapter %1$d of %2$d + Page %1$d of %2$d All chapters read Bookmarked Not bookmarked @@ -79,10 +80,6 @@ %1$s chapter %1$s chapters - - %1$d page left - %1$d pages left - Category