mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +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>,
|
||||
)
|
||||
: 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 {
|
||||
|
@ -217,13 +217,14 @@ Stream<List<FileMLInstruction>> fetchEmbeddingsAndInstructions(
|
||||
faces.addAll(facesFromRemoteEmbedding);
|
||||
existingInstruction.shouldRunFaces = false;
|
||||
}
|
||||
if (fileMl.clipEmbedding != null &&
|
||||
fileMl.clipEmbedding!.version >= clipMlVersion) {
|
||||
final remoteClipEmbedding =
|
||||
fileMl.getClipEmbeddingIfCompatible(clipMlVersion);
|
||||
if (remoteClipEmbedding != null) {
|
||||
clipEmbeddings.add(
|
||||
ClipEmbedding(
|
||||
fileID: fileMl.fileID,
|
||||
embedding: fileMl.clipEmbedding!.embedding,
|
||||
version: fileMl.clipEmbedding!.version,
|
||||
embedding: remoteClipEmbedding.embedding,
|
||||
version: remoteClipEmbedding.version,
|
||||
),
|
||||
);
|
||||
existingInstruction.shouldRunClip = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user