-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: chapter tracker overhaul: add switch, replace existing tracker logic if enabled fix: sync page progress regardless of chapter index chore: change log level feat: Komga page-based sync
- Loading branch information
1 parent
6d4267b
commit acfb276
Showing
11 changed files
with
327 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
app/src/main/java/eu/kanade/tachiyomi/data/track/PageTracker.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package eu.kanade.tachiyomi.data.track | ||
|
||
import eu.kanade.tachiyomi.data.database.models.Chapter | ||
|
||
|
||
/** | ||
* | ||
*/ | ||
interface PageTracker { | ||
|
||
data class ChapterReadProgress( | ||
val completed: Boolean, | ||
val page: Int | ||
) { | ||
operator fun compareTo(b: ChapterReadProgress): Int = | ||
if (completed == b.completed) page.coerceAtLeast(0) - b.page.coerceAtLeast(0) | ||
else completed.compareTo(b.completed) | ||
|
||
} | ||
|
||
suspend fun updatePageProgress(track: tachiyomi.domain.track.model.Track, page: Int) {} | ||
suspend fun updatePageProgressWithUrl(chapterUrl:String, page: Int) {} | ||
|
||
suspend fun batchUpdateRemoteProgress(chapters: List<Chapter>) | ||
|
||
suspend fun getChapterProgress(chapter: Chapter): ChapterReadProgress | ||
suspend fun batchGetChapterProgress(chapters: List<Chapter>): Map<Chapter, ChapterReadProgress> { | ||
return chapters.associateWith { getChapterProgress(it) } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.