Skip to content

Commit

Permalink
fix and documentation #69
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvanie85 committed Jul 15, 2024
1 parent 2dedec9 commit 344ab55
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
6 changes: 4 additions & 2 deletions datastore/db/queries/picture/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ def change_picture_set_id(cursor, user_id, old_picture_set_id, new_picture_set_i
- picture_set_id (str): The UUID of the PictureSet to retrieve the pictures from.
"""
try :
if get_picture_set_owner_id(cursor, old_picture_set_id) != user_id or get_picture_set_owner_id(cursor, new_picture_set_id) != user_id:
raise PictureUpdateError(f"Error: picture set not own by user :{user_id}")
if get_picture_set_owner_id(cursor, old_picture_set_id) != user_id :
raise PictureUpdateError(f"Error: old picture set not own by user :{user_id}")
if get_picture_set_owner_id(cursor, new_picture_set_id) != user_id :
raise PictureUpdateError(f"Error: new picture set not own by user :{user_id}")

query = """
UPDATE picture
Expand Down
33 changes: 33 additions & 0 deletions doc/nachet-manage-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ training purposes. Our solution is to request confirmation from the user, who
can decide to delete pictures from his container but let us save them, or he can
delete everything anyway, for example if there has been a missed click.

Users have asked to be able to access the pictures of folders in the directory
section on frontend. We want them to be able to see each pictures name. Then a
user can select a folder this will get all pictures and their inferences.

## Prerequisites

- The user must be signed in and have an Azure Storage Container
Expand Down Expand Up @@ -137,3 +141,32 @@ note left of FE : "Are you sure ? Everything in this folder will be deleted and
end
```

### Get folder content user case

```mermaid
sequenceDiagram
participant User
participant FE as Frontend
participant BE as Backend
participant DS as Datastore
User->>FE: ApplicationStart()
FE-->>BE: /directories
BE->>DS: get_picture_sets_info(user_id)
loop for each picture set
DS-->DS: get_pictures(user_id, picture_set_id)
end
DS-->>BE: List of picture_set with pictures name
BE-->>FE: Response : List of picture_set with pictures name
User->>FE: Select Folder
FE->>BE: /get-folder-content
BE->>DS: get_picture_set_content(user_id, picture_set_id)
loop for each picture
DS-->DS: get_picture_hash(user_id, picture_id)
DS-->DS: get_picture_inference(user_id, picture_id)
end
DS-->>BE: Return pictures with inferences
BE-->>FE: Send pictures
FE-->>User: Display folder content (list of pictures)
```

0 comments on commit 344ab55

Please sign in to comment.