mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 09:49:28 +01:00
Minor fixes
This commit is contained in:
parent
12d6919421
commit
4e784cd7c3
@ -87,4 +87,8 @@ public class Chapter implements Serializable {
|
|||||||
public boolean isDownloaded() {
|
public boolean isDownloaded() {
|
||||||
return status == Download.DOWNLOADED;
|
return status == Download.DOWNLOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRecognizedNumber() {
|
||||||
|
return chapter_number >= 0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ class ChaptersPresenter : BasePresenter<ChaptersFragment>() {
|
|||||||
|
|
||||||
fun markPreviousChaptersAsRead(selected: Chapter) {
|
fun markPreviousChaptersAsRead(selected: Chapter) {
|
||||||
Observable.from(chapters)
|
Observable.from(chapters)
|
||||||
.filter { it.chapter_number > -1 && it.chapter_number < selected.chapter_number }
|
.filter { it.isRecognizedNumber && it.chapter_number < selected.chapter_number }
|
||||||
.doOnNext { it.read = true }
|
.doOnNext { it.read = true }
|
||||||
.toList()
|
.toList()
|
||||||
.flatMap { db.updateChaptersProgress(it).asRxObservable() }
|
.flatMap { db.updateChaptersProgress(it).asRxObservable() }
|
||||||
|
@ -260,7 +260,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
|||||||
page_seekbar.max = numPages - 1
|
page_seekbar.max = numPages - 1
|
||||||
page_seekbar.progress = currentPage
|
page_seekbar.progress = currentPage
|
||||||
|
|
||||||
setToolbarSubtitle(if (chapter.chapter_number != -1f)
|
setToolbarSubtitle(if (chapter.isRecognizedNumber)
|
||||||
getString(R.string.chapter_subtitle, decimalFormat.format(chapter.chapter_number.toDouble()))
|
getString(R.string.chapter_subtitle, decimalFormat.format(chapter.chapter_number.toDouble()))
|
||||||
else
|
else
|
||||||
chapter.name)
|
chapter.name)
|
||||||
|
@ -71,7 +71,7 @@ fun syncChaptersWithSource(db: DatabaseHelper,
|
|||||||
val c = toAdd[i]
|
val c = toAdd[i]
|
||||||
c.date_fetch = now++
|
c.date_fetch = now++
|
||||||
// Try to mark already read chapters as read when the source deletes them
|
// Try to mark already read chapters as read when the source deletes them
|
||||||
if (c.chapter_number != -1f && c.chapter_number in deletedReadChapterNumbers) {
|
if (c.isRecognizedNumber && c.chapter_number in deletedReadChapterNumbers) {
|
||||||
c.read = true
|
c.read = true
|
||||||
readded++
|
readded++
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user