mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 15:30:40 +00:00
minor refactor
This commit is contained in:
parent
4fd3a269b0
commit
e42024c912
@ -85,6 +85,17 @@ class FileDataEntity {
|
|||||||
remoteRawData[_clipKey] as Map<String, dynamic>,
|
remoteRawData[_clipKey] as Map<String, dynamic>,
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
RemoteClipEmbedding? getClipEmbeddingIfCompatible(
|
||||||
|
int minClipMlVersion,
|
||||||
|
) {
|
||||||
|
final clipData = remoteRawData[_clipKey];
|
||||||
|
if (clipData == null) return null;
|
||||||
|
|
||||||
|
final clipEmbedding =
|
||||||
|
RemoteClipEmbedding.fromJson(clipData as Map<String, dynamic>);
|
||||||
|
return clipEmbedding.version >= minClipMlVersion ? clipEmbedding : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RemoteFaceEmbedding {
|
class RemoteFaceEmbedding {
|
||||||
|
@ -217,13 +217,14 @@ Stream<List<FileMLInstruction>> fetchEmbeddingsAndInstructions(
|
|||||||
faces.addAll(facesFromRemoteEmbedding);
|
faces.addAll(facesFromRemoteEmbedding);
|
||||||
existingInstruction.shouldRunFaces = false;
|
existingInstruction.shouldRunFaces = false;
|
||||||
}
|
}
|
||||||
if (fileMl.clipEmbedding != null &&
|
final remoteClipEmbedding =
|
||||||
fileMl.clipEmbedding!.version >= clipMlVersion) {
|
fileMl.getClipEmbeddingIfCompatible(clipMlVersion);
|
||||||
|
if (remoteClipEmbedding != null) {
|
||||||
clipEmbeddings.add(
|
clipEmbeddings.add(
|
||||||
ClipEmbedding(
|
ClipEmbedding(
|
||||||
fileID: fileMl.fileID,
|
fileID: fileMl.fileID,
|
||||||
embedding: fileMl.clipEmbedding!.embedding,
|
embedding: remoteClipEmbedding.embedding,
|
||||||
version: fileMl.clipEmbedding!.version,
|
version: remoteClipEmbedding.version,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
existingInstruction.shouldRunClip = false;
|
existingInstruction.shouldRunClip = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user