Modern Apps git

← Modern-Apps.git

photos: disable OCR for next release

Commit
fff8b93ea516b81f9ba1ef06bf75efa1d6095b97
Author
Vayun Mathur <[email protected]>
When
2026-04-27 20:11 UTC (7 months ago)
Parents
0b0cb91

Diff

photos/src/main/java/com/vayunmathur/photos/ui/GalleryPage.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/ui/GalleryPage.kt b/photos/src/main/java/com/vayunmathur/photos/ui/GalleryPage.ktindex 090c1396aa..60fc91f458 100644--- a/photos/src/main/java/com/vayunmathur/photos/ui/GalleryPage.kt+++ b/photos/src/main/java/com/vayunmathur/photos/ui/GalleryPage.kt@@ -251,6 +251,10 @@ fun GalleryPage(                     }                 )             } else {+                TopAppBar(+                    title = { Text(stringResource(R.string.app_name)) },+                )+                /*                 SearchBar(                     inputField = {                         SearchBarDefaults.InputField(@@ -424,6 +428,7 @@ fun GalleryPage(                         }                     }                 )+                */             }         },         bottomBar = { if (!isSelectionMode) NavigationBar(Route.Gallery, backStack) }
photos/src/main/java/com/vayunmathur/photos/util/SyncWorker.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/util/SyncWorker.kt b/photos/src/main/java/com/vayunmathur/photos/util/SyncWorker.ktindex 1ac8f2920a..9d44090f4f 100644--- a/photos/src/main/java/com/vayunmathur/photos/util/SyncWorker.kt+++ b/photos/src/main/java/com/vayunmathur/photos/util/SyncWorker.kt@@ -37,6 +37,8 @@ import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.ensureActive+import kotlinx.coroutines.sync.Mutex+import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.withContext import java.util.concurrent.TimeUnit @@ -129,12 +131,16 @@ class SyncWorker(context: Context, params: WorkerParameters) : CoroutineWorker(c }  class OCRWorker(context: Context, params: WorkerParameters) : CoroutineWorker(context, params) {+     override suspend fun doWork(): WorkResult = withContext(Dispatchers.IO) {-        setForeground(createForegroundInfo())-        val database = applicationContext.buildDatabase<PhotoDatabase>(PhotoDatabase.ALL_MIGRATIONS)-        val photos = database.photoDao().getAll<Photo>()-        runOCR(photos, database, applicationContext)-        WorkResult.success()+        ocrMutex.withLock {+            setForeground(createForegroundInfo())+            val database =+                applicationContext.buildDatabase<PhotoDatabase>(PhotoDatabase.ALL_MIGRATIONS)+            val photos = database.photoDao().getAll<Photo>()+            runOCR(photos, database, applicationContext)+            WorkResult.success()+        }     }      private fun createForegroundInfo(): ForegroundInfo {@@ -163,6 +169,8 @@ class OCRWorker(context: Context, params: WorkerParameters) : CoroutineWorker(co      companion object {         private const val WORK_NAME = "OCRWorker"+        private val ocrMutex = Mutex() // Shared across all instances of OCRWorker+          fun enqueue(context: Context) {             val request = OneTimeWorkRequestBuilder<OCRWorker>().build()