Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions .github/workflows/pr-check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
pull_request:
paths:
- "frontend/**"



jobs:
tauri-build-check:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-check-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
pull_request:
branches:
- main



jobs:
linting:
runs-on: ubuntu-latest
Expand Down
19 changes: 14 additions & 5 deletions backend/app/database/folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,11 @@ def db_get_folder_ids_by_paths(


def db_get_all_folder_details() -> (
List[Tuple[str, str, Optional[str], int, bool, Optional[bool]]]
List[Tuple[str, str, Optional[str], int, bool, Optional[bool], int]]
):
"""
Get all folder details including folder_id, folder_path, parent_folder_id,
last_modified_time, AI_Tagging, and taggingCompleted.
last_modified_time, AI_Tagging, taggingCompleted, and image_count.
Returns list of tuples with all folder information.
"""
conn = sqlite3.connect(DATABASE_PATH)
Expand All @@ -408,9 +408,18 @@ def db_get_all_folder_details() -> (
try:
cursor.execute(
"""
SELECT folder_id, folder_path, parent_folder_id, last_modified_time, AI_Tagging, taggingCompleted
FROM folders
ORDER BY folder_path
SELECT
f.folder_id,
f.folder_path,
f.parent_folder_id,
f.last_modified_time,
f.AI_Tagging,
f.taggingCompleted,
COUNT(i.id) as image_count
FROM folders f
LEFT JOIN images i ON f.folder_id = i.folder_id
GROUP BY f.folder_id
ORDER BY f.folder_path
"""
)
return cursor.fetchall()
Expand Down
2 changes: 2 additions & 0 deletions backend/app/routes/folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ def get_all_folders():
last_modified_time,
ai_tagging,
tagging_completed,
image_count,
) = folder_data
folders.append(
FolderDetails(
Expand All @@ -460,6 +461,7 @@ def get_all_folders():
last_modified_time=last_modified_time,
AI_Tagging=ai_tagging,
taggingCompleted=tagging_completed,
image_count=image_count,
)
)

Expand Down
1 change: 1 addition & 0 deletions backend/app/schemas/folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class FolderDetails(BaseModel):
last_modified_time: int
AI_Tagging: bool
taggingCompleted: Optional[bool] = None
image_count: int = 0


class GetAllFoldersData(BaseModel):
Expand Down
2 changes: 2 additions & 0 deletions backend/tests/test_folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def sample_folder_details():
1693526400, # timestamp
True, # AI_Tagging
False, # taggingCompleted
0, # image_count
),
(
"folder-id-2",
Expand All @@ -106,6 +107,7 @@ def sample_folder_details():
1693526500,
False,
True,
25,
),
]

Expand Down
118 changes: 118 additions & 0 deletions docs/backend/backend_python/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2253,6 +2253,11 @@
}
],
"title": "Taggingcompleted"
},
"image_count": {
"type": "integer",
"title": "Image Count",
"default": 0
}
},
"type": "object",
Expand Down Expand Up @@ -3407,6 +3412,119 @@
"type"
],
"title": "ValidationError"
},
"app__schemas__face_clusters__ErrorResponse": {
"properties": {
"success": {
"type": "boolean",
"title": "Success",
"default": false
},
"message": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Message"
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error"
}
},
"type": "object",
"title": "ErrorResponse"
},
"app__schemas__folders__ErrorResponse": {
"properties": {
"success": {
"type": "boolean",
"title": "Success",
"default": false
},
"message": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Message"
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error"
}
},
"type": "object",
"title": "ErrorResponse"
},
"app__schemas__images__ErrorResponse": {
"properties": {
"success": {
"type": "boolean",
"title": "Success",
"default": false
},
"message": {
"type": "string",
"title": "Message"
},
"error": {
"type": "string",
"title": "Error"
}
},
"type": "object",
"required": [
"message",
"error"
],
"title": "ErrorResponse"
},
"app__schemas__user_preferences__ErrorResponse": {
"properties": {
"success": {
"type": "boolean",
"title": "Success"
},
"error": {
"type": "string",
"title": "Error"
},
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"success",
"error",
"message"
],
"title": "ErrorResponse",
"description": "Error response model"
}
}
}
Expand Down
Loading
Loading