Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob] Update as per new API spec

Neeraj Guptad3e73035d118
diff --git a/mobile/lib/services/filedata/filedata_service.dart b/mobile/lib/services/filedata/filedata_service.dart
index ec4c27fb17..1d7d184050 100644
--- a/mobile/lib/services/filedata/filedata_service.dart
+++ b/mobile/lib/services/filedata/filedata_service.dart
@@ -48,11 +48,11 @@ class FileDataService {
Future<FileDataResponse> getFilesData(
Set<int> fileIds, {
- DataType type = DataType.derivedMeta,
+ DataType type = DataType.mlData,
}) async {
try {
final res = await _dio.post(
- "/files/fetch-data/",
+ "/files/data/fetch",
data: {
"fileIDs": fileIds.toList(),
"type": type.toJson(),
diff --git a/mobile/lib/services/filedata/model/file_data.dart b/mobile/lib/services/filedata/model/file_data.dart
index f6f501e47b..2c06cf601c 100644
--- a/mobile/lib/services/filedata/model/file_data.dart
+++ b/mobile/lib/services/filedata/model/file_data.dart
@@ -4,7 +4,7 @@ const _faceKey = 'face';
const _clipKey = 'clip';
enum DataType {
- derivedMeta('derivedMeta');
+ mlData('mldata');
final String value;
const DataType(this.value);
@@ -34,7 +34,7 @@ class FileDataEntity {
);
void validate() {
- if (type == DataType.derivedMeta) {
+ if (type == DataType.mlData) {
if (remoteRawData[_faceKey] == null) {
throw Exception('Face embedding is null');
}
@@ -64,12 +64,12 @@ class FileDataEntity {
}
void putFace(RemoteFaceEmbedding faceEmbedding) {
- assert(type == DataType.derivedMeta, 'Invalid type ${type.value}');
+ assert(type == DataType.mlData, 'Invalid type ${type.value}');
remoteRawData[_faceKey] = faceEmbedding.toJson();
}
void putClip(RemoteClipEmbedding clipEmbedding) {
- assert(type == DataType.derivedMeta, 'Invalid type ${type.value}');
+ assert(type == DataType.mlData, 'Invalid type ${type.value}');
remoteRawData[_clipKey] = clipEmbedding.toJson();
}
diff --git a/mobile/lib/services/machine_learning/ml_service.dart b/mobile/lib/services/machine_learning/ml_service.dart
index 7db1ea13a4..7bf0e2dfd5 100644
--- a/mobile/lib/services/machine_learning/ml_service.dart
+++ b/mobile/lib/services/machine_learning/ml_service.dart
@@ -453,7 +453,7 @@ class MLService {
final FileDataEntity dataEntity = instruction.existingRemoteFileML ??
FileDataEntity.empty(
instruction.file.uploadedFileID!,
- DataType.derivedMeta,
+ DataType.mlData,
);
if (result.facesRan) {
dataEntity.putFace(