Skip to content

Commit 005402b

Browse files
chore: ruff
1 parent a6baeba commit 005402b

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

invokeai/app/api/routers/images.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,9 @@ async def get_bulk_download_item(
565565
raise HTTPException(status_code=404)
566566

567567

568-
@images_router.get("/collections/counts", operation_id="get_image_collection_counts", response_model=ImageCollectionCounts)
568+
@images_router.get(
569+
"/collections/counts", operation_id="get_image_collection_counts", response_model=ImageCollectionCounts
570+
)
569571
async def get_image_collection_counts(
570572
image_origin: Optional[ResourceOrigin] = Query(default=None, description="The origin of images to count."),
571573
categories: Optional[list[ImageCategory]] = Query(default=None, description="The categories of image to include."),

invokeai/app/services/image_records/image_records_common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def deserialize_image_record(image_dict: dict) -> ImageRecord:
208208
has_workflow=has_workflow,
209209
)
210210

211+
211212
class ImageCollectionCounts(BaseModel):
212213
starred_count: int = Field(description="The number of starred images in the collection.")
213214
unstarred_count: int = Field(description="The number of unstarred images in the collection.")

invokeai/app/services/image_records/image_records_sqlite.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,12 @@ def get_image_names(
626626
query_params.append(f"%{search_term.lower()}%")
627627

628628
# Order by starred first, then by created_at
629-
query += query_conditions + f"""--sql
629+
query += (
630+
query_conditions
631+
+ f"""--sql
630632
ORDER BY images.starred DESC, images.created_at {order_dir.value}
631633
"""
634+
)
632635

633636
cursor.execute(query, query_params)
634637
result = cast(list[sqlite3.Row], cursor.fetchall())

invokeai/app/services/images/images_default.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from time import time
21
from typing import Literal, Optional
32

43
from PIL.Image import Image as PILImageType

0 commit comments

Comments
 (0)