mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 01:06:21 +01:00
Fix username in NC is case-insensitive
This commit is contained in:
parent
1102ffd67c
commit
6fd9ad7bc4
2 changed files with 3 additions and 2 deletions
|
@ -261,7 +261,7 @@ class ListAlbumBloc extends Bloc<ListAlbumBlocEvent, ListAlbumBlocState> {
|
|||
final items = albums.map((e) {
|
||||
final isSharedByMe = shares.any((element) =>
|
||||
element.path.trimAny("/") == e.albumFile!.strippedPath);
|
||||
final isSharedToMe = e.albumFile!.ownerId != ev.account.username;
|
||||
final isSharedToMe = !e.albumFile!.isOwned(ev.account.username);
|
||||
return ListAlbumBlocItem(e, isSharedByMe, isSharedToMe);
|
||||
}).toList();
|
||||
|
||||
|
|
|
@ -461,7 +461,8 @@ extension FileExtension on File {
|
|||
}
|
||||
}
|
||||
|
||||
bool isOwned(String username) => ownerId == null || ownerId == username;
|
||||
bool isOwned(String username) =>
|
||||
ownerId == null || ownerId?.toLowerCase() == username.toLowerCase();
|
||||
|
||||
static final _log = Logger("entity.file.FileExtension");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue