[mob] Minor fix to reflect correct status for indexing
This commit is contained in:
parent
d6599f178b
commit
e4dcdeb030
3 changed files with 6 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
|||
import "package:photos/events/event.dart";
|
||||
|
||||
class EmbeddingUpdatedEvent extends Event {}
|
||||
|
||||
class EmbeddingCacheUpdatedEvent extends Event {}
|
||||
|
|
|
@ -190,6 +190,7 @@ class SemanticSearchService {
|
|||
_logger.info(
|
||||
"Loading ${_cachedEmbeddings.length} took: ${(endTime.millisecondsSinceEpoch - startTime.millisecondsSinceEpoch)}ms",
|
||||
);
|
||||
Bus.instance.fire(EmbeddingCacheUpdatedEvent());
|
||||
_logger.info("Cached embeddings: " + _cachedEmbeddings.length.toString());
|
||||
}
|
||||
|
||||
|
@ -227,6 +228,7 @@ class SemanticSearchService {
|
|||
.getOwnedFileIDs(Configuration.instance.getUserID()!);
|
||||
final embeddedFileIDs =
|
||||
await EmbeddingsDB.instance.getFileIDs(_currentModel);
|
||||
|
||||
uploadedFileIDs.removeWhere(
|
||||
(id) => embeddedFileIDs.contains(id),
|
||||
);
|
||||
|
|
|
@ -228,13 +228,13 @@ class MagicSearchIndexStatsWidget extends StatefulWidget {
|
|||
class _MagicSearchIndexStatsWidgetState
|
||||
extends State<MagicSearchIndexStatsWidget> {
|
||||
IndexStatus? _status;
|
||||
late StreamSubscription<EmbeddingUpdatedEvent> _eventSubscription;
|
||||
late StreamSubscription<EmbeddingCacheUpdatedEvent> _eventSubscription;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_eventSubscription =
|
||||
Bus.instance.on<EmbeddingUpdatedEvent>().listen((event) {
|
||||
Bus.instance.on<EmbeddingCacheUpdatedEvent>().listen((event) {
|
||||
_fetchIndexStatus();
|
||||
});
|
||||
_fetchIndexStatus();
|
||||
|
|
Loading…
Reference in a new issue