From 800c480e1b27dbcc196d30fe03e9f0eaad4ee749 Mon Sep 17 00:00:00 2001 From: Ahmed Nabil Date: Sat, 16 May 2026 17:08:24 +0300 Subject: [PATCH] Expose reading session updates --- .../com/quran/shared/pipeline/SyncService.kt | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/sync-pipelines/src/commonMain/kotlin/com/quran/shared/pipeline/SyncService.kt b/sync-pipelines/src/commonMain/kotlin/com/quran/shared/pipeline/SyncService.kt index 2b4a6b5..66addbf 100644 --- a/sync-pipelines/src/commonMain/kotlin/com/quran/shared/pipeline/SyncService.kt +++ b/sync-pipelines/src/commonMain/kotlin/com/quran/shared/pipeline/SyncService.kt @@ -314,6 +314,35 @@ class SyncService( } } + @NativeCoroutines + suspend fun updateReadingSession(localId: String, sura: Int, ayah: Int): ReadingSession { + try { + val readingSession = readingSessionsRepository.updateReadingSession(localId, sura, ayah) + triggerSync() + return readingSession + } catch (e: Exception) { + Logger.e(e) { "Failed to update reading session" } + throw e + } + } + + @NativeCoroutines + suspend fun updateReadingSession( + localId: String, + sura: Int, + ayah: Int, + timestamp: PlatformDateTime + ): ReadingSession { + try { + val readingSession = readingSessionsRepository.updateReadingSession(localId, sura, ayah, timestamp) + triggerSync() + return readingSession + } catch (e: Exception) { + Logger.e(e) { "Failed to update reading session" } + throw e + } + } + @NativeCoroutines suspend fun deleteReadingBookmark(): Boolean { try {