Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: unassign faces #9374

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions e2e/src/api/specs/asset.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,18 @@ describe('/asset', () => {
expect(body).toMatchObject({
id: user1Assets[0].id,
isFavorite: false,
people: [
{
birthDate: null,
id: expect.any(String),
isHidden: false,
name: 'Test Person',
thumbnailPath: '/my/awesome/thumbnail.jpg',
},
],
people: {
faces: [
{
birthDate: null,
id: expect.any(String),
isHidden: false,
name: 'Test Person',
thumbnailPath: '/my/awesome/thumbnail.jpg',
},
],
numberOfFaces: 1,
},
});

const sharedLink = await utils.createSharedLink(user1.accessToken, {
Expand All @@ -231,7 +234,7 @@ describe('/asset', () => {

const data = await request(app).get(`/asset/${user1Assets[0].id}?key=${sharedLink.key}`);
expect(data.status).toBe(200);
expect(data.body).toMatchObject({ people: [] });
expect(data.body).not.toHaveProperty('people');
});
});

Expand Down Expand Up @@ -480,15 +483,18 @@ describe('/asset', () => {
expect(body).toMatchObject({
id: user1Assets[0].id,
isFavorite: true,
people: [
{
birthDate: null,
id: expect.any(String),
isHidden: false,
name: 'Test Person',
thumbnailPath: '/my/awesome/thumbnail.jpg',
},
],
people: {
faces: [
{
birthDate: null,
id: expect.any(String),
isHidden: false,
name: 'Test Person',
thumbnailPath: '/my/awesome/thumbnail.jpg',
},
],
numberOfFaces: 1,
},
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/services/asset.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AssetService {
final AssetResponseDto? dto =
await _apiService.assetApi.getAssetInfo(remoteId);

return dto?.people;
return dto?.people?.faces;
} catch (error, stack) {
log.severe(
'Error while getting remote asset info: ${error.toString()}',
Expand Down
3 changes: 3 additions & 0 deletions mobile/openapi/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ doc/PathType.md
doc/PeopleResponseDto.md
doc/PeopleUpdateDto.md
doc/PeopleUpdateItem.md
doc/PeopleWithFacesResponseDto.md
doc/PersonApi.md
doc/PersonCreateDto.md
doc/PersonResponseDto.md
Expand Down Expand Up @@ -350,6 +351,7 @@ lib/model/path_type.dart
lib/model/people_response_dto.dart
lib/model/people_update_dto.dart
lib/model/people_update_item.dart
lib/model/people_with_faces_response_dto.dart
lib/model/person_create_dto.dart
lib/model/person_response_dto.dart
lib/model/person_statistics_response_dto.dart
Expand Down Expand Up @@ -550,6 +552,7 @@ test/path_type_test.dart
test/people_response_dto_test.dart
test/people_update_dto_test.dart
test/people_update_item_test.dart
test/people_with_faces_response_dto_test.dart
test/person_api_test.dart
test/person_create_dto_test.dart
test/person_response_dto_test.dart
Expand Down
3 changes: 3 additions & 0 deletions mobile/openapi/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mobile/openapi/doc/AssetResponseDto.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions mobile/openapi/doc/FaceApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions mobile/openapi/doc/PeopleWithFacesResponseDto.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions mobile/openapi/doc/PersonApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mobile/openapi/lib/api.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions mobile/openapi/lib/api/face_api.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions mobile/openapi/lib/api/person_api.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions mobile/openapi/lib/api_client.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading