mirror of
https://github.com/immich-app/immich.git
synced 2025-09-29 15:31:13 -04:00
* change dto from integer to double * feat(mobile): edit location action * patch openapi * refactor in provider * fix lint * chore: not showing success prompt if dimissed * i18n --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
51 lines
1.6 KiB
Dart
51 lines
1.6 KiB
Dart
import 'package:drift/drift.dart';
|
|
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
|
import 'package:immich_mobile/infrastructure/entities/exif.entity.drift.dart';
|
|
import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart';
|
|
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
|
import 'package:maplibre_gl/maplibre_gl.dart';
|
|
|
|
class DriftRemoteAssetRepository extends DriftDatabaseRepository {
|
|
final Drift _db;
|
|
const DriftRemoteAssetRepository(this._db) : super(_db);
|
|
|
|
Future<void> updateFavorite(List<String> ids, bool isFavorite) {
|
|
return _db.batch((batch) async {
|
|
for (final id in ids) {
|
|
batch.update(
|
|
_db.remoteAssetEntity,
|
|
RemoteAssetEntityCompanion(isFavorite: Value(isFavorite)),
|
|
where: (e) => e.id.equals(id),
|
|
);
|
|
}
|
|
});
|
|
}
|
|
|
|
Future<void> updateVisibility(List<String> ids, AssetVisibility visibility) {
|
|
return _db.batch((batch) async {
|
|
for (final id in ids) {
|
|
batch.update(
|
|
_db.remoteAssetEntity,
|
|
RemoteAssetEntityCompanion(visibility: Value(visibility)),
|
|
where: (e) => e.id.equals(id),
|
|
);
|
|
}
|
|
});
|
|
}
|
|
|
|
Future<void> updateLocation(List<String> ids, LatLng location) {
|
|
return _db.batch((batch) async {
|
|
for (final id in ids) {
|
|
batch.update(
|
|
_db.remoteExifEntity,
|
|
RemoteExifEntityCompanion(
|
|
latitude: Value(location.latitude),
|
|
longitude: Value(location.longitude),
|
|
),
|
|
where: (e) => e.assetId.equals(id),
|
|
);
|
|
}
|
|
});
|
|
}
|
|
}
|