(api) ruff

This commit is contained in:
maryhipp 2024-06-30 18:41:07 -04:00 committed by psychedelicious
parent da05034e20
commit 93951dcf82
5 changed files with 6 additions and 15 deletions

View File

@ -328,15 +328,7 @@ async def list_image_dtos(
"""Gets a list of image DTOs"""
image_dtos = ApiDependencies.invoker.services.images.get_many(
offset,
limit,
starred_first,
order_dir,
image_origin,
categories,
is_intermediate,
board_id,
search_term
offset, limit, starred_first, order_dir, image_origin, categories, is_intermediate, board_id, search_term
)
return image_dtos

View File

@ -217,7 +217,7 @@ class SqliteImageRecordStorage(ImageRecordStorageBase):
query_conditions += """--sql
AND json_extract(images.metadata, '$') LIKE ?
"""
query_params.append(f'%{search_term}%')
query_params.append(f"%{search_term}%")
if starred_first:
query_pagination = f"""--sql

View File

@ -123,7 +123,7 @@ class ImageServiceABC(ABC):
categories: Optional[list[ImageCategory]] = None,
is_intermediate: Optional[bool] = None,
board_id: Optional[str] = None,
search_term: Optional[str] = None
search_term: Optional[str] = None,
) -> OffsetPaginatedResults[ImageDTO]:
"""Gets a paginated list of image DTOs."""
pass

View File

@ -214,7 +214,7 @@ class ImageService(ImageServiceABC):
categories: Optional[list[ImageCategory]] = None,
is_intermediate: Optional[bool] = None,
board_id: Optional[str] = None,
search_term: Optional[str] = None
search_term: Optional[str] = None,
) -> OffsetPaginatedResults[ImageDTO]:
try:
results = self.__invoker.services.image_records.get_many(
@ -226,7 +226,7 @@ class ImageService(ImageServiceABC):
categories,
is_intermediate,
board_id,
search_term
search_term,
)
image_dtos = [

View File

@ -15,7 +15,6 @@ from invokeai.app.services.shared.sqlite_migrator.migrations.migration_9 import
from invokeai.app.services.shared.sqlite_migrator.migrations.migration_10 import build_migration_10
from invokeai.app.services.shared.sqlite_migrator.migrations.migration_11 import build_migration_11
from invokeai.app.services.shared.sqlite_migrator.migrations.migration_12 import build_migration_12
from invokeai.app.services.shared.sqlite_migrator.migrations.migration_13 import build_migration_13
from invokeai.app.services.shared.sqlite_migrator.sqlite_migrator_impl import SqliteMigrator
@ -48,7 +47,7 @@ def init_db(config: InvokeAIAppConfig, logger: Logger, image_files: ImageFileSto
migrator.register_migration(build_migration_10())
migrator.register_migration(build_migration_11(app_config=config, logger=logger))
migrator.register_migration(build_migration_12(app_config=config))
migrator.register_migration(build_migration_13())
# migrator.register_migration(build_migration_13())
migrator.run_migrations()
return db