@@ -22,6 +22,7 @@ import androidx.annotation.VisibleForTesting
2222import androidx.fragment.app.FragmentActivity
2323import androidx.lifecycle.lifecycleScope
2424import anki.collection.OpChanges
25+ import com.ichi2.anki.CollectionManager
2526import com.ichi2.anki.CollectionManager.withCol
2627import com.ichi2.anki.NoteEditor
2728import com.ichi2.anki.importAnkiPackageUndoable
@@ -36,6 +37,7 @@ import com.ichi2.libanki.getDeckNamesRaw
3637import com.ichi2.libanki.getFieldNamesRaw
3738import com.ichi2.libanki.getImportAnkiPackagePresetsRaw
3839import com.ichi2.libanki.getNotetypeNamesRaw
40+ import com.ichi2.libanki.sched.computeFsrsParamsRaw
3941import com.ichi2.libanki.sched.computeOptimalRetentionRaw
4042import com.ichi2.libanki.sched.evaluateParamsRaw
4143import com.ichi2.libanki.sched.simulateFsrsReviewRaw
@@ -82,7 +84,6 @@ val collectionMethods =
8284 " getImageForOcclusion" to { bytes -> getImageForOcclusionRaw(bytes) },
8385 " getImageOcclusionNote" to { bytes -> getImageOcclusionNoteRaw(bytes) },
8486 " setWantsAbort" to { bytes -> setWantsAbortRaw(bytes) },
85- " latestProgress" to { bytes -> latestProgressRaw(bytes) },
8687 " getSchedulingStatesWithContext" to { bytes -> getSchedulingStatesWithContextRaw(bytes) },
8788 " setSchedulingStates" to { bytes -> setSchedulingStatesRaw(bytes) },
8889 " getChangeNotetypeInfo" to { bytes -> getChangeNotetypeInfoRaw(bytes) },
@@ -110,6 +111,7 @@ val uiMethods =
110111 hashMapOf<String , UIBackendInterface >(
111112 " searchInBrowser" to { bytes -> lifecycleScope.async { searchInBrowser(bytes) } },
112113 " updateDeckConfigs" to { bytes -> lifecycleScope.async { updateDeckConfigsRaw(bytes) } },
114+ " latestProgress" to { bytes -> lifecycleScope.async { CollectionManager .getBackend().latestProgressRaw(bytes) } },
113115 " importCsv" to { bytes -> lifecycleScope.async { importCsvRaw(bytes) } },
114116 " importAnkiPackage" to { bytes -> lifecycleScope.async { importAnkiPackageUndoable(bytes) } },
115117 " addImageOcclusionNote" to { bytes ->
@@ -122,7 +124,7 @@ val uiMethods =
122124 withCol { updateImageOcclusionNoteRaw(bytes) }
123125 }
124126 },
125- " computeFsrsParams" to { bytes -> lifecycleScope.async { computeFsrsParams (bytes) } },
127+ " computeFsrsParams" to { bytes -> lifecycleScope.async { withCol { computeFsrsParamsRaw (bytes) } } },
126128 " deckOptionsReady" to { bytes -> lifecycleScope.async { deckOptionsReady(bytes) } },
127129 " deckOptionsRequireClose" to { bytes -> lifecycleScope.async { deckOptionsRequireClose(bytes) } },
128130 )
0 commit comments