[mob][photos] Rename

This commit is contained in:
laurenspriem
2024-06-26 23:09:27 +05:30
parent 3a8b2cf7b8
commit ca7096b87c
3 changed files with 6 additions and 5 deletions

View File

@@ -102,7 +102,7 @@ class FaceMlService {
static const _embeddingFetchLimit = 200;
static const _kForceClusteringFaceCount = 8000;
/// Only call this function once at app startup, after that you can directly call [indexAndClusterAll]
/// Only call this function once at app startup, after that you can directly call [runAllFaceML]
Future<void> init() async {
if (LocalSettings.instance.isFaceIndexingEnabled == false ||
_isInitialized) {
@@ -127,7 +127,7 @@ class FaceMlService {
"MLController allowed running ML, faces indexing starting",
);
}
unawaited(indexAndClusterAll());
unawaited(runAllFaceML());
} else {
_logger.info(
"MLController stopped running ML, faces indexing will be paused (unless it's fetching embeddings)",
@@ -164,7 +164,7 @@ class FaceMlService {
_isSyncing = false;
}
Future<void> indexAndClusterAll() async {
Future<void> runAllFaceML() async {
if (_cannotRunMLFunction()) return;
await sync(forceSync: _shouldSyncPeople);

View File

@@ -149,7 +149,7 @@ class _FaceDebugSectionWidgetState extends State<FaceDebugSectionWidget> {
onTap: () async {
try {
FaceMlService.instance.debugIndexingDisabled = false;
unawaited(FaceMlService.instance.indexAndClusterAll());
unawaited(FaceMlService.instance.runAllFaceML());
} catch (e, s) {
_logger.warning('indexAndClusterAll failed ', e, s);
await showGenericErrorDialog(context: context, error: e);

View File

@@ -223,7 +223,8 @@ class _MachineLearningSettingsPageState
final isEnabled =
await LocalSettings.instance.toggleFaceIndexing();
if (isEnabled) {
unawaited(FaceMlService.instance.indexAndClusterAll());
await FaceMlService.instance.init();
unawaited(FaceMlService.instance.runAllFaceML());
} else {
FaceMlService.instance.pauseIndexingAndClustering();
}