many improvements and prototype launcher image
This commit is contained in:
1 parent
11c8f7c6e4
commit
6422f814d1
27 files changed
+530
-232
No files matched your search
@@ -255,9 +255,24 @@ actual suspend fun saveLibraryReadingPosition(fileId: String, position: ReadingP
|
||||
}
|
||||
}
|
||||
|
||||
actual suspend fun clearLibraryReadingPosition(fileId: String) = withContext(Dispatchers.IO) {
|
||||
openLibraryDatabase().useLibrary { db ->
|
||||
val file = db.files.get(fileId) ?: return@useLibrary
|
||||
val clusterId = file.bodyClusterId ?: return@useLibrary
|
||||
db.readingStates.deleteForBodyCluster(clusterId)
|
||||
}
|
||||
Unit
|
||||
}
|
||||
|
||||
actual suspend fun markLibraryReadingStatus(fileId: String, status: BookReadingStatus): Boolean = withContext(Dispatchers.IO) {
|
||||
openLibraryDatabase().useLibrary { db ->
|
||||
db.files.updateReadingStatus(fileId, status)
|
||||
db.transaction {
|
||||
if (status == BookReadingStatus.NEW) {
|
||||
val file = files.get(fileId) ?: return@transaction false
|
||||
file.bodyClusterId?.let { readingStates.deleteForBodyCluster(it) }
|
||||
}
|
||||
files.updateReadingStatus(fileId, status)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user