feat(api): remove order_by in favor of starred_first for images records

This commit is contained in:
psychedelicious 2024-06-28 16:27:20 +10:00
parent c96ccae70b
commit 9e664d7c58

View File

@ -12,7 +12,6 @@ from invokeai.app.invocations.fields import MetadataField
from invokeai.app.services.image_records.image_records_common import ( from invokeai.app.services.image_records.image_records_common import (
ImageCategory, ImageCategory,
ImageRecordChanges, ImageRecordChanges,
OrderByOptions,
ResourceOrigin, ResourceOrigin,
) )
from invokeai.app.services.images.images_common import ImageDTO, ImageUrlsDTO from invokeai.app.services.images.images_common import ImageDTO, ImageUrlsDTO
@ -322,15 +321,15 @@ async def list_image_dtos(
), ),
offset: int = Query(default=0, description="The page offset"), offset: int = Query(default=0, description="The page offset"),
limit: int = Query(default=10, description="The number of images per page"), limit: int = Query(default=10, description="The number of images per page"),
order_by: OrderByOptions = Query(default=OrderByOptions.CREATED_AT, description="The way to sort the images"),
order_dir: SQLiteDirection = Query(default=SQLiteDirection.Descending, description="The order of sort"), order_dir: SQLiteDirection = Query(default=SQLiteDirection.Descending, description="The order of sort"),
starred_first: bool = Query(default=True, description="Whether to sort by starred images first"),
) -> OffsetPaginatedResults[ImageDTO]: ) -> OffsetPaginatedResults[ImageDTO]:
"""Gets a list of image DTOs""" """Gets a list of image DTOs"""
image_dtos = ApiDependencies.invoker.services.images.get_many( image_dtos = ApiDependencies.invoker.services.images.get_many(
offset, offset,
limit, limit,
order_by, starred_first,
order_dir, order_dir,
image_origin, image_origin,
categories, categories,