1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-09 23:17:29 +02:00

refactor(mobile): remove int user id (#16814)

* refactor: user entity

* chore: rebase fixes

* refactor: remove int user Id

* refactor: migrate store userId from int to string

* refactor: rename uid to id

* fix: migration

* pr feedback

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong
2025-03-18 21:35:37 +05:30
committed by GitHub
parent e96ffd43e7
commit 9cf3b88f80
38 changed files with 182 additions and 157 deletions

View File

@@ -28,6 +28,7 @@ import 'package:immich_mobile/repositories/asset.repository.dart';
import 'package:immich_mobile/repositories/backup.repository.dart';
import 'package:immich_mobile/services/entity.service.dart';
import 'package:immich_mobile/services/sync.service.dart';
import 'package:immich_mobile/utils/hash.dart';
import 'package:logging/logging.dart';
final albumServiceProvider = Provider(
@@ -208,7 +209,7 @@ class AlbumService {
final Album album = await _albumApiRepository.create(
albumName,
assetIds: assets.map((asset) => asset.remoteId!),
sharedUserIds: sharedUsers.map((user) => user.uid),
sharedUserIds: sharedUsers.map((user) => user.id),
);
await _entityService.fillAlbumWithDatabaseEntities(album);
return _albumRepository.create(album);
@@ -296,7 +297,7 @@ class AlbumService {
Future<bool> deleteAlbum(Album album) async {
try {
final userId = _userService.getMyUser().id;
if (album.owner.value?.isarId == userId) {
if (album.owner.value?.isarId == fastHash(userId)) {
await _albumApiRepository.delete(album.remoteId!);
}
if (album.shared) {
@@ -362,7 +363,7 @@ class AlbumService {
try {
await _albumApiRepository.removeUser(
album.remoteId!,
userId: user.uid,
userId: user.id,
);
album.sharedUsers.remove(entity.User.fromDto(user));