mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-26 08:54:42 +01:00
Deprecate FavoriteResyncedEvent
This commit is contained in:
parent
b7c0b187e2
commit
50d38d374e
3 changed files with 2 additions and 13 deletions
|
@ -89,6 +89,7 @@ class ShareRemovedEvent {
|
|||
final Share share;
|
||||
}
|
||||
|
||||
@Deprecated("not fired anymore, to be removed")
|
||||
class FavoriteResyncedEvent {
|
||||
const FavoriteResyncedEvent(this.account);
|
||||
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:kiwi/kiwi.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:nc_photos/account.dart';
|
||||
import 'package:nc_photos/db/entity_converter.dart';
|
||||
import 'package:nc_photos/di_container.dart';
|
||||
import 'package:nc_photos/event/event.dart';
|
||||
import 'package:np_codegen/np_codegen.dart';
|
||||
import 'package:np_db/np_db.dart';
|
||||
|
||||
|
@ -20,14 +17,10 @@ class CacheFavorite {
|
|||
Future<DbSyncIdResult> call(
|
||||
Account account, Iterable<int> remoteFileIds) async {
|
||||
_log.info("[call] Cache favorites");
|
||||
final result = await _c.npDb.syncFavoriteFiles(
|
||||
return _c.npDb.syncFavoriteFiles(
|
||||
account: account.toDb(),
|
||||
favoriteFileIds: remoteFileIds.toList(),
|
||||
);
|
||||
if (result.isNotEmpty) {
|
||||
KiwiContainer().resolve<EventBus>().fire(FavoriteResyncedEvent(account));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
final DiContainer _c;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:flutter_isolate/flutter_isolate.dart';
|
||||
import 'package:kiwi/kiwi.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
@ -11,7 +10,6 @@ import 'package:nc_photos/controller/files_controller.dart';
|
|||
import 'package:nc_photos/controller/persons_controller.dart';
|
||||
import 'package:nc_photos/di_container.dart';
|
||||
import 'package:nc_photos/entity/person.dart';
|
||||
import 'package:nc_photos/event/event.dart';
|
||||
import 'package:nc_photos/use_case/person/sync_person.dart';
|
||||
import 'package:nc_photos/use_case/sync_favorite.dart';
|
||||
import 'package:nc_photos/use_case/sync_tag.dart';
|
||||
|
@ -96,9 +94,6 @@ class StartupSync {
|
|||
_$StartupSyncNpLog.log.info('[_broadcastResult] $result');
|
||||
if (result.syncFavoriteResult != null) {
|
||||
filesController.applySyncResult(favorites: result.syncFavoriteResult!);
|
||||
// legacy
|
||||
final eventBus = KiwiContainer().resolve<EventBus>();
|
||||
eventBus.fire(FavoriteResyncedEvent(account));
|
||||
}
|
||||
if (result.isSyncPersonUpdated) {
|
||||
personsController.reload();
|
||||
|
|
Loading…
Add table
Reference in a new issue