mirror of
https://github.com/immich-app/immich.git
synced 2025-01-28 00:59:18 -05:00
efbc0cb192
* Initial look at fixing issue where images are uploaded to the wrong album if a shared album conflicts with a local users album. * Use owner instead of shared flag when fetching albums. * Fix issue with refreshRemoteAlbums getting shared items twice and removed incorrect isShared comment. Using `getAll(shared: true)` gets all shared albums the user can access (regardless of owner, despite the previous comment). Using `getAll(shared: null)` gets all albums (incuding shared = true and shared = false). I presume the intent here was to get albums that were shared (and not mine), and not shared (ie: mine), but the logic is way off. It also just then combines them - so makes more sense to just get them in a single call. * Fix formatting. * Fixed tests. * Revert "Fixed tests." This reverts commitc38f5af5ac
. * Revert "Fix issue with refreshRemoteAlbums getting shared items twice and removed incorrect isShared comment." This reverts commit979ce90abf
. * Added comments to explain why filters behave the way they do for getAll() albums. --------- Co-authored-by: Tom graham <tomg@questps.com.au> Co-authored-by: Alex <alex.tran1502@gmail.com>
47 lines
1.2 KiB
Dart
47 lines
1.2 KiB
Dart
import 'package:immich_mobile/entities/album.entity.dart';
|
|
import 'package:immich_mobile/entities/asset.entity.dart';
|
|
import 'package:immich_mobile/entities/user.entity.dart';
|
|
import 'package:immich_mobile/interfaces/database.interface.dart';
|
|
import 'package:immich_mobile/models/albums/album_search.model.dart';
|
|
|
|
abstract interface class IAlbumRepository implements IDatabaseRepository {
|
|
Future<Album> create(Album album);
|
|
|
|
Future<Album?> get(int id);
|
|
|
|
Future<Album?> getByName(
|
|
String name, {
|
|
bool? shared,
|
|
bool? remote,
|
|
bool? owner,
|
|
});
|
|
|
|
Future<List<Album>> getAll({
|
|
bool? shared,
|
|
bool? remote,
|
|
int? ownerId,
|
|
AlbumSort? sortBy,
|
|
});
|
|
|
|
Future<Album> update(Album album);
|
|
|
|
Future<void> delete(int albumId);
|
|
|
|
Future<void> deleteAllLocal();
|
|
|
|
Future<int> count({bool? local});
|
|
|
|
Future<void> addUsers(Album album, List<User> users);
|
|
|
|
Future<void> removeUsers(Album album, List<User> users);
|
|
|
|
Future<void> addAssets(Album album, List<Asset> assets);
|
|
|
|
Future<void> removeAssets(Album album, List<Asset> assets);
|
|
|
|
Future<Album> recalculateMetadata(Album album);
|
|
|
|
Future<List<Album>> search(String searchTerm, QuickFilterMode filterMode);
|
|
}
|
|
|
|
enum AlbumSort { remoteId, localId }
|