mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
27 lines
740 B
Dart
27 lines
740 B
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:np_codegen/np_codegen.dart';
|
|
import 'package:np_db/np_db.dart';
|
|
|
|
part 'cache_favorite.g.dart';
|
|
|
|
@npLog
|
|
class CacheFavorite {
|
|
const CacheFavorite(this._c);
|
|
|
|
/// Cache favorites using results from remote
|
|
///
|
|
/// Return the fileIds of the affected files
|
|
Future<DbSyncIdResult> call(
|
|
Account account, Iterable<int> remoteFileIds) async {
|
|
_log.info("[call] Cache favorites");
|
|
return _c.npDb.syncFavoriteFiles(
|
|
account: account.toDb(),
|
|
favoriteFileIds: remoteFileIds.toList(),
|
|
);
|
|
}
|
|
|
|
final DiContainer _c;
|
|
}
|