Skip to content

Commit

Permalink
feat: unassign faces
Browse files Browse the repository at this point in the history
  • Loading branch information
martabal committed May 11, 2024
1 parent 757840c commit 7e7454a
Show file tree
Hide file tree
Showing 45 changed files with 1,372 additions and 270 deletions.
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

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

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.

0 comments on commit 7e7454a

Please sign in to comment.