Skip to content

Commit

Permalink
Api: Lighten the request getting all portraits of a given database
Browse files Browse the repository at this point in the history
We only need to return the surname, the first name and the occurrence
number of the person.
  • Loading branch information
ilankri committed Oct 24, 2024
1 parent f6d922c commit bc463f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
20 changes: 6 additions & 14 deletions src/api.ml
Original file line number Diff line number Diff line change
Expand Up @@ -417,20 +417,12 @@ let print_img_all conf base =
else
Api_util.print_result conf (fl list)
in
let compute_sosa = Api_util.compute_sosa conf base false in
if Api_util.p_getenvbin conf.env "full_infos" = Some "1" then
aux
(fun p img ->
let p = Api_util.pers_to_piqi_person_full conf base p compute_sosa in
Api_piqi.Full_image.({person = p; img = img;}))
(fun list -> Api_piqi_ext.gen_list_full_images @@ Api_piqi.List_full_images.({images = list}) )
else
aux
(fun p img ->
let p = Api_util.pers_to_piqi_person_light conf base p compute_sosa in
Api_piqi.Image.({person = p; img}))
(fun list ->
Api_piqi_ext.gen_list_images @@ Api_piqi.List_images.({list_images = list}))
aux
(fun p img ->
let p = Api_util.person_to_reference_person base p in
Api_piqi.Image.({person = p; img}))
(fun list ->
Api_piqi_ext.gen_list_images @@ Api_piqi.List_images.({list_images = list}))

(**/**) (* API_IMAGE_APP *)

Expand Down
11 changes: 1 addition & 10 deletions src/assets/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -241,23 +241,14 @@ message SearchParams {
}

message Image {
required Person person = 1;
required string img = 2;
}

message FullImage {
required FullPerson person = 1;
required ReferencePerson person = 1;
required string img = 2;
}

message ListImages {
repeated Image list_images = 1;
}

message ListFullImages {
repeated FullImage images = 1;
}

message PersImg {
required ReferencePerson person = 1;
required string img = 2;
Expand Down

0 comments on commit bc463f3

Please sign in to comment.